提交 feafbb9e 编写于 作者: K kener

jshint~

上级 17c739b7
...@@ -25,8 +25,6 @@ define(function(require) { ...@@ -25,8 +25,6 @@ define(function(require) {
var ecConfig = require('../config'); var ecConfig = require('../config');
var ecData = require('../util/ecData'); var ecData = require('../util/ecData');
var zrColor = require('zrender/tool/color');
var self = this; var self = this;
self.type = ecConfig.CHART_TYPE_K; self.type = ecConfig.CHART_TYPE_K;
...@@ -42,14 +40,11 @@ define(function(require) { ...@@ -42,14 +40,11 @@ define(function(require) {
top : [], top : [],
bottom : [] bottom : []
}; };
var xAxisIndex;
var yAxisIndex;
var xAxis; var xAxis;
for (var i = 0, l = series.length; i < l; i++) { 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] = self.reformOption(series[i]); series[i] = self.reformOption(series[i]);
xAxisIndex = series[i].xAxisIndex; xAxis = component.xAxis.getAxis(series[i].xAxisIndex);
xAxis = component.xAxis.getAxis(xAxisIndex);
if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY
) { ) {
_position2sIndexMap[xAxis.getPosition()].push(i); _position2sIndexMap[xAxis.getPosition()].push(i);
......
...@@ -25,7 +25,6 @@ define(function(require) { ...@@ -25,7 +25,6 @@ define(function(require) {
var ecConfig = require('../config'); var ecConfig = require('../config');
var ecData = require('../util/ecData'); var ecData = require('../util/ecData');
var zrMath = require('zrender/tool/math');
var zrUtil = require('zrender/tool/util'); var zrUtil = require('zrender/tool/util');
var self = this; var self = this;
...@@ -75,10 +74,8 @@ define(function(require) { ...@@ -75,10 +74,8 @@ define(function(require) {
if (key != 'value') { if (key != 'value') {
valueData[name][key] = data[j][key]; valueData[name][key] = data[j][key];
} }
else { else if (!isNaN(data[j].value)) {
if (!isNaN(data[j].value)) { valueData[name].value += data[j].value;
valueData[name].value += data[j].value;
}
} }
} }
//索引有该区域的系列样式 //索引有该区域的系列样式
...@@ -135,7 +132,7 @@ define(function(require) { ...@@ -135,7 +132,7 @@ define(function(require) {
]; ];
} }
} }
return scale return scale;
} }
function _buildMap(mapData, valueData) { function _buildMap(mapData, valueData) {
......
...@@ -90,7 +90,7 @@ define(function(require) { ...@@ -90,7 +90,7 @@ define(function(require) {
var data; var data;
var value; var value;
var xAxis; var xAxis;
var yAxis var yAxis;
var pointList = {}; var pointList = {};
var x; var x;
...@@ -99,7 +99,7 @@ define(function(require) { ...@@ -99,7 +99,7 @@ define(function(require) {
for (var j = 0, k = seriesArray.length; j < k; j++) { for (var j = 0, k = seriesArray.length; j < k; j++) {
seriesIndex = seriesArray[j]; seriesIndex = seriesArray[j];
serie = series[seriesIndex]; serie = series[seriesIndex];
if (serie.data.length == 0) { if (serie.data.length === 0) {
continue; continue;
} }
...@@ -142,7 +142,6 @@ define(function(require) { ...@@ -142,7 +142,6 @@ define(function(require) {
* 生成折线和折线上的拐点 * 生成折线和折线上的拐点
*/ */
function _buildPointList(pointList) { function _buildPointList(pointList) {
var zrColor = require('zrender/tool/color');
var nColor; // normal var nColor; // normal
var eColor; // emphasis var eColor; // emphasis
...@@ -297,7 +296,7 @@ define(function(require) { ...@@ -297,7 +296,7 @@ define(function(require) {
}; };
break; break;
} }
itemShape._serieIndex = seriesIndex itemShape._serieIndex = seriesIndex;
itemShape.zlevel = _zlevelBase; itemShape.zlevel = _zlevelBase;
itemShape.style.color = nColor; itemShape.style.color = nColor;
itemShape.style.strokeColor = nColor; itemShape.style.strokeColor = nColor;
...@@ -370,7 +369,6 @@ define(function(require) { ...@@ -370,7 +369,6 @@ define(function(require) {
* 动画设定 * 动画设定
*/ */
function animation() { function animation() {
return;
var duration = self.deepQuery([option], 'animationDuration'); var duration = self.deepQuery([option], 'animationDuration');
var easing = self.deepQuery([option], 'animationEasing'); var easing = self.deepQuery([option], 'animationEasing');
var x; var x;
......
...@@ -14,7 +14,7 @@ define(function (require) { ...@@ -14,7 +14,7 @@ define(function (require) {
* @param {Object} option 图表参数 * @param {Object} option 图表参数
* @param {Object=} selected 用于状态保持 * @param {Object=} selected 用于状态保持
*/ */
function DataRange(messageCenter, zr, option, selected) { function DataRange(messageCenter, zr, option) {
var Base = require('./base'); var Base = require('./base');
Base.call(this, zr); Base.call(this, zr);
...@@ -75,7 +75,6 @@ define(function (require) { ...@@ -75,7 +75,6 @@ define(function (require) {
var textShape; var textShape;
var font = self.getFont(dataRangeOption.textStyle); var font = self.getFont(dataRangeOption.textStyle);
var zrWidth = zr.getWidth();
var lastX = _itemGroupLocation.x; var lastX = _itemGroupLocation.x;
var lastY = _itemGroupLocation.y; var lastY = _itemGroupLocation.y;
var itemWidth = dataRangeOption.itemWidth; var itemWidth = dataRangeOption.itemWidth;
...@@ -187,19 +186,15 @@ define(function (require) { ...@@ -187,19 +186,15 @@ define(function (require) {
* 构建渐变型的值域元素 * 构建渐变型的值域元素
*/ */
function _buildGradient() { function _buildGradient() {
var itemName;
var itemShape; var itemShape;
var textShape; var textShape;
var font = self.getFont(dataRangeOption.textStyle); var font = self.getFont(dataRangeOption.textStyle);
var zrWidth = zr.getWidth();
var lastX = _itemGroupLocation.x; var lastX = _itemGroupLocation.x;
var lastY = _itemGroupLocation.y; var lastY = _itemGroupLocation.y;
var itemWidth = dataRangeOption.itemWidth; var itemWidth = dataRangeOption.itemWidth;
var itemHeight = dataRangeOption.itemHeight; var itemHeight = dataRangeOption.itemHeight;
var itemGap = dataRangeOption.itemGap;
var textHeight = zrArea.getTextWidth('', font); var textHeight = zrArea.getTextWidth('', font);
var color;
var needValueText = true; var needValueText = true;
...@@ -270,7 +265,7 @@ define(function (require) { ...@@ -270,7 +265,7 @@ define(function (require) {
if (dataRangeOption.calculable) { if (dataRangeOption.calculable) {
_calculableLocation = itemShape.style; _calculableLocation = itemShape.style;
_buildFiller(); _buildFiller();
_bulidMask() _bulidMask();
_bulidHandle(); _bulidHandle();
} }
...@@ -335,8 +330,8 @@ define(function (require) { ...@@ -335,8 +330,8 @@ define(function (require) {
// 手柄统统在下方 // 手柄统统在下方
pointListStart = [ pointListStart = [
[x, y], [x, y],
[x, y + height + textHieght + textHieght / 2], [x, y + height + textHieght / 2 * 3],
[x - textWidth, y + height + textHieght + textHieght / 2], [x - textWidth, y + height + textHieght / 2 * 3],
[x - textWidth, y + height + textHieght / 2], [x - textWidth, y + height + textHieght / 2],
[x - textHieght / 2, y + height + textHieght / 2], [x - textHieght / 2, y + height + textHieght / 2],
[x - 1, y + height], [x - 1, y + height],
...@@ -348,10 +343,10 @@ define(function (require) { ...@@ -348,10 +343,10 @@ define(function (require) {
pointListEnd = [ pointListEnd = [
[x + width, y], [x + width, y],
[x + width, y + height + textHieght + textHieght / 2], [x + width, y + height + textHieght / 2 * 3],
[x + width + textWidth, y + height + textHieght + textHieght / 2], [x + width + textWidth, y + height + textHieght/2*3],
[x + width + textWidth, y + height + textHieght / 2], [x + width + textWidth, y + height + textHieght / 2],
[x + width + textHieght / 2, y + height + textHieght / 2], [x + width + textHieght / 2, y + height + textHieght/2],
[x + width + 1, y + height], [x + width + 1, y + height],
[x + width + 1, y] [x + width + 1, y]
]; ];
...@@ -362,8 +357,8 @@ define(function (require) { ...@@ -362,8 +357,8 @@ define(function (require) {
// 手柄在上方 // 手柄在上方
pointListStart = [ pointListStart = [
[x, y + height], [x, y + height],
[x, y - textHieght - textHieght / 2], [x, y - textHieght / 2 * 3],
[x - textWidth, y - textHieght - textHieght / 2], [x - textWidth, y - textHieght / 2 * 3],
[x - textWidth, y - textHieght / 2], [x - textWidth, y - textHieght / 2],
[x - textHieght / 2, y - textHieght / 2], [x - textHieght / 2, y - textHieght / 2],
[x - 1, y], [x - 1, y],
...@@ -375,8 +370,8 @@ define(function (require) { ...@@ -375,8 +370,8 @@ define(function (require) {
pointListEnd = [ pointListEnd = [
[x + width, y + height], [x + width, y + height],
[x + width, y - textHieght - textHieght / 2], [x + width, y - textHieght / 2 * 3],
[x + width + textWidth, y - textHieght - textHieght / 2], [x + width + textWidth, y - textHieght / 2 * 3],
[x + width + textWidth, y - textHieght / 2], [x + width + textWidth, y - textHieght / 2],
[x + width + textHieght / 2, y - textHieght / 2], [x + width + textHieght / 2, y - textHieght / 2],
[x + width + 1, y], [x + width + 1, y],
...@@ -767,7 +762,7 @@ define(function (require) { ...@@ -767,7 +762,7 @@ define(function (require) {
textAlign: (dataRangeOption.orient == 'horizontal' textAlign: (dataRangeOption.orient == 'horizontal'
? 'left' : 'center') ? 'left' : 'center')
} }
} };
} }
// 色尺legend item shape // 色尺legend item shape
...@@ -928,7 +923,7 @@ define(function (require) { ...@@ -928,7 +923,7 @@ define(function (require) {
} }
else if (e.id == _endShape.id && a >= b) { else if (e.id == _endShape.id && a >= b) {
// _endShape触发 // _endShape触发
a = b;; a = b;
_startShape.style.x = a; _startShape.style.x = a;
} }
_fillerShae.style.x = a; _fillerShae.style.x = a;
...@@ -950,7 +945,7 @@ define(function (require) { ...@@ -950,7 +945,7 @@ define(function (require) {
} }
else if (e.id == _endShape.id && a >= b) { else if (e.id == _endShape.id && a >= b) {
// _endShape触发 // _endShape触发
a = b;; a = b;
_startShape.style.y = a; _startShape.style.y = a;
} }
_fillerShae.style.y = a; _fillerShae.style.y = a;
......
...@@ -353,7 +353,7 @@ define(function (require) { ...@@ -353,7 +353,7 @@ define(function (require) {
brushType : 'both' brushType : 'both'
}, },
clickable : true clickable : true
} };
default : default :
return { return {
shape : 'rectangle', shape : 'rectangle',
......
...@@ -601,7 +601,7 @@ define(function (require) { ...@@ -601,7 +601,7 @@ define(function (require) {
} }
else { else {
_tDom.innerHTML = serie.name + '<br/>' + _tDom.innerHTML = serie.name + '<br/>' +
(name == '' ? '' : (name + ' : ')) (name === '' ? '' : (name + ' : '))
+ value + + value +
(typeof speical == 'undefined' (typeof speical == 'undefined'
? '' ? ''
......
...@@ -647,7 +647,7 @@ define(function (require) { ...@@ -647,7 +647,7 @@ define(function (require) {
} }
} }
_min = -splitGap * splitNumber + _max;; _min = -splitGap * splitNumber + _max;
} }
else { else {
// 一正一负,确保0被选中 // 一正一负,确保0被选中
......
...@@ -327,8 +327,8 @@ define(function() { ...@@ -327,8 +327,8 @@ define(function() {
scatter: { scatter: {
xAxisIndex: 0, xAxisIndex: 0,
yAxisIndex: 0, yAxisIndex: 0,
//symbol: null, // 图形类型,非标准参数 //symbol: null, // 图形类型,非标准参数
symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
}, },
// 饼图默认参数 // 饼图默认参数
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -74,8 +74,6 @@ ...@@ -74,8 +74,6 @@
*/ */
define( define(
function(require) { function(require) {
var matrix = require('zrender/tool/matrix');
function Symbol() { function Symbol() {
this.type = 'symbol'; this.type = 'symbol';
} }
...@@ -166,8 +164,8 @@ define( ...@@ -166,8 +164,8 @@ define(
buildPath : function(ctx, style) { buildPath : function(ctx, style) {
var pointList = style.pointList; var pointList = style.pointList;
var rect = this.getRect(style); var rect = this.getRect(style);
console.log(rect) // console.log(rect)
var ti = new Date(); // var ti = new Date();
var pixels = ctx.getImageData( var pixels = ctx.getImageData(
rect.x, rect.y, rect.width, rect.height rect.x, rect.y, rect.width, rect.height
); );
...@@ -190,7 +188,7 @@ define( ...@@ -190,7 +188,7 @@ define(
data[idx + 3] = 255; data[idx + 3] = 255;
} }
ctx.putImageData(pixels, rect.x, rect.y); ctx.putImageData(pixels, rect.x, rect.y);
console.log(new Date() - ti); // console.log(new Date() - ti);
return; return;
}, },
...@@ -203,8 +201,7 @@ define( ...@@ -203,8 +201,7 @@ define(
return shape.get('polygon').getRect(style); return shape.get('polygon').getRect(style);
}, },
isCover : function() {
isCover : function(e, x, y) {
return false; return false;
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册