提交 09541038 编写于 作者: K kener

jshint代码规范

上级 a03bcc67
......@@ -19,7 +19,7 @@
"trailing": false,
"maxparams": 20,
"maxdepth": 6,
"maxlen": 80,
"maxlen": 100,
"asi": false,
"boss": false,
......
......@@ -358,7 +358,7 @@ define(function(require) {
for (var m = 0, n = locationMap[j].length; m < n; m++) {
seriesIndex = locationMap[j][m];
xMarkMap[seriesIndex].average =
(xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0
(xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0;
y = component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0)
.getCoord(xMarkMap[seriesIndex].average);
......
......@@ -301,7 +301,7 @@ define(function(require) {
var normalColor = self.getItemStyleColor(normal.color, seriesIndex, dataIndex, data)
|| defaultColor;
var emphasisColor = self.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data)
var emphasisColor = self.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data)
|| (typeof normalColor == 'string'
? zrColor.lift(normalColor, -0.2)
: normalColor
......@@ -326,7 +326,6 @@ define(function(require) {
},
highlightStyle : {
color : emphasisColor,
strokeColor : 'rgba(0,0,0,0)',
lineWidth : emphasis.borderWidth,
strokeColor : emphasis.borderColor,
lineJoin: 'round'
......
......@@ -152,7 +152,7 @@ define(function(require) {
]);
}
_markMap(xAxis, yAxis, serie.data, pointList[seriesIndex])
_markMap(xAxis, yAxis, serie.data, pointList[seriesIndex]);
self.buildMark(
serie,
seriesIndex,
......
......@@ -514,7 +514,8 @@ define(function(require) {
}
// 标准化一些参数
data[i][0].tooltip = mergeData.tooltip || {trigger:'item'}; // tooltip.trigger指定为item
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'
......@@ -547,7 +548,7 @@ define(function(require) {
itemShape,
serie, seriesIndex,
data[i][0], 0,
data[i][0].name + (data[i][1].name != ''
data[i][0].name + (data[i][1].name !== ''
? (' > ' + data[i][1].name) : '')
);
pList.push(itemShape);
......@@ -866,7 +867,6 @@ define(function(require) {
}
function animationMark(duration , easing) {
var mlShape = require('zrender/shape').get('markLine');
var x;
var y;
for (var i = 0, l = self.shapeList.length; i < l; i++) {
......@@ -1063,9 +1063,10 @@ define(function(require) {
else if (shape._mark === 'line') {
effectShape.style.x = shape.style.xStart - Offset;
effectShape.style.y = shape.style.yStart - Offset;
var distance = (shape.style.xStart - shape._x) * (shape.style.xStart - shape._x)
+
(shape.style.yStart - shape._y) * (shape.style.yStart - shape._y);
var distance =
(shape.style.xStart - shape._x) * (shape.style.xStart - shape._x)
+
(shape.style.yStart - shape._y) * (shape.style.yStart - shape._y);
duration = Math.round(Math.sqrt(Math.round(
distance * effect.period * effect.period
)));
......
......@@ -350,7 +350,7 @@ define(function (require) {
var pointListEnd;
var textXEnd;
var textYEnd;
var coverRectEnd
var coverRectEnd;
if (dataRangeOption.orient == 'horizontal') {
// 水平
if (dataRangeOption.y != 'bottom') {
......@@ -459,7 +459,7 @@ define(function (require) {
y : y + height,
width : textWidth + textHeight,
height : textHeight
}
};
}
else {
// 手柄在左侧
......@@ -539,7 +539,7 @@ define(function (require) {
_endShape.highlightStyle = {
strokeColor : _endShape.style.color,
lineWidth : 1
}
};
// 统一参数
_startShape.zlevel = _endShape.zlevel = _zlevelBase + 1;
......
......@@ -62,7 +62,6 @@ define(function (require) {
var itemShape;
var textShape;
var textStyle = legendOption.textStyle;
var font = self.getFont(textStyle);
var dataTextStyle;
var dataFont;
......@@ -449,7 +448,6 @@ define(function (require) {
*/
function _getSomethingByName(name) {
var series = option.series;
var hasFind;
var data;
for (var i = 0, l = series.length; i < l; i++) {
if (series[i].name == name) {
......@@ -460,7 +458,7 @@ define(function (require) {
seriesIndex : i,
data : null,
dataIndex : -1
}
};
}
if (
......@@ -480,7 +478,7 @@ define(function (require) {
seriesIndex : i,
data : data[j],
dataIndex : j
}
};
}
}
}
......@@ -491,7 +489,7 @@ define(function (require) {
seriesIndex : -1,
data : null,
dataIndex : -1
}
};
}
function _getItemShapeByType(x, y, width, height, color, itemType, defaultColor) {
......
......@@ -853,7 +853,6 @@ define(function (require) {
len = newOption.series.length;
var oriType; // 备份还原可控类型
var oriStack; // 备份还原堆积名称
var axis;
while (len--) {
oriType = newOption.series[len].type;
......@@ -924,15 +923,6 @@ define(function (require) {
}
}
function _hasMagicType() {
for (var k in _magicType) {
if (_magicType[k]) {
return true;
}
}
return false;
}
function getMagicOption(){
var axis;
if (_magicType[ecConfig.CHART_TYPE_LINE] || _magicType[ecConfig.CHART_TYPE_BAR]) {
......
......@@ -396,7 +396,7 @@ define(function (require) {
right = curCoord;
}
if (x - left < right - x) {
dataIndex -= dataIndex != 0 ? 1 : 0;
dataIndex -= dataIndex !== 0 ? 1 : 0;
}
else {
// 离右边近,看是否为最后一个
......@@ -426,7 +426,7 @@ define(function (require) {
}
if (y - top > bottom - y) {
dataIndex -= dataIndex != 0 ? 1 : 0;
dataIndex -= dataIndex !== 0 ? 1 : 0;
}
else {
// 离上方边近,看是否为最后一个
......@@ -1356,7 +1356,7 @@ define(function (require) {
return;
}
var polarIndex = serie.polarIndex || 0;
var vector = polar.getVector(polarIndex, dataIndex, 'max')
var vector = polar.getVector(polarIndex, dataIndex, 'max');
_event = {
zrenderX : vector[0],
zrenderY : vector[1]
......@@ -1399,7 +1399,7 @@ define(function (require) {
&& ecData.get(shapeList[i], 'dataIndex') == dataIndex
) {
_curTarget = shapeList[i];
var vector = polar.getCenter(serie.polarIndex || 0)
var vector = polar.getCenter(serie.polarIndex || 0);
x = vector[0];
y = vector[1];
break;
......
......@@ -55,7 +55,7 @@ define(function(require) {
*/
self.getInstanceById = function(key) {
return _instances[key];
}
};
/**
* 基于zrender实现Echarts接口层
......@@ -165,9 +165,9 @@ define(function(require) {
*/
var _curEventType = null; // 破循环信号灯
function _onevent(param){
param.__echarts_id__ = param.__echarts_id__ || self.id;
param.__echartsId = param.__echartsId || self.id;
var fromMyself = true;
if (param.__echarts_id__ != self.id) {
if (param.__echartsId != self.id) {
// 来自其他联动图表的事件
fromMyself = false;
}
......@@ -793,9 +793,9 @@ define(function(require) {
_chartList.push(chart);
self.chart[chartType] = chart;
}
}
else {
console.error(chartType + ' has not been required.');
else {
console.error(chartType + ' has not been required.');
}
}
}
......@@ -1338,7 +1338,7 @@ define(function(require) {
}
var tempDom;
var domSize = domSize = [
var domSize = [
dom.offsetLeft, dom.offsetTop,
dom.offsetWidth, dom.offsetHeight
];
......@@ -1367,7 +1367,7 @@ define(function(require) {
top : domSize[1],
right : domSize[0] + domSize[2],
bottom : domSize[1] + domSize[3]
}
};
minLeft = Math.min(minLeft, imgList[c].left);
minTop = Math.min(minTop, imgList[c].top);
maxRight = Math.max(maxRight, imgList[c].right);
......@@ -1499,7 +1499,7 @@ define(function(require) {
* 联动事件响应
*/
function connectedEventHandler(param) {
if (param.__echarts_id__ != self.id) {
if (param.__echartsId != self.id) {
// 来自其他联动图表的事件
_onevent(param);
}
......@@ -1509,7 +1509,7 @@ define(function(require) {
* 是否存在多图联动
*/
function isConnected() {
return !!_connected
return !!_connected;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册