提交 fcf80fef 编写于 作者: S sushuang

fix(lint): fix code style by eslint.

上级 ae7fbad7
parserOptions:
ecmaVersion: 3
# If using ES Module, ecmaVersion have to be set as `2015`.
ecmaVersion: 2015
sourceType: "module"
env:
browser: true
......
......@@ -104,7 +104,7 @@ export default echarts.extendComponentView({
/* map 3.0 */
var originalStyle2 = bMapModel.__mapStyle2;
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
var newMapStyle2 = bMapModel.get('mapStyleV2') || {};
// FIXME, Not use JSON methods
var mapStyleStr2 = JSON.stringify(newMapStyle2);
if (JSON.stringify(originalStyle2) !== mapStyleStr2) {
......
......@@ -99,7 +99,7 @@ function parseNodes(parent, attributesMap) {
// z
}
if (vizColorDom) {
node.itemStyle.normal.color = 'rgb(' +[
node.itemStyle.normal.color = 'rgb(' + [
getAttr(vizColorDom, 'r') | 0,
getAttr(vizColorDom, 'g') | 0,
getAttr(vizColorDom, 'b') | 0
......@@ -130,7 +130,7 @@ function parseNodes(parent, attributesMap) {
attValue = parseFloat(attValue);
break;
case 'boolean':
attValue = attValue.toLowerCase() == 'true';
attValue = attValue.toLowerCase() === 'true';
break;
default:
}
......@@ -189,16 +189,17 @@ function getAttr(el, attrName) {
return el.getAttribute(attrName);
}
function getChildByTagName (parent, tagName) {
function getChildByTagName(parent, tagName) {
var node = parent.firstChild;
while (node) {
if (
node.nodeType != 1 ||
node.nodeName.toLowerCase() != tagName.toLowerCase()
node.nodeType !== 1
|| node.nodeName.toLowerCase() !== tagName.toLowerCase()
) {
node = node.nextSibling;
} else {
}
else {
return node;
}
}
......@@ -206,11 +207,11 @@ function getChildByTagName (parent, tagName) {
return null;
}
function getChildrenByTagName (parent, tagName) {
function getChildrenByTagName(parent, tagName) {
var node = parent.firstChild;
var children = [];
while (node) {
if (node.nodeName.toLowerCase() == tagName.toLowerCase()) {
if (node.nodeName.toLowerCase() === tagName.toLowerCase()) {
children.push(node);
}
node = node.nextSibling;
......
parserOptions:
ecmaVersion: 3
# If using ES Module, ecmaVersion have to be set as `2015`.
ecmaVersion: 2015
sourceType: "module"
env:
browser: true
......
......@@ -104,7 +104,7 @@ function labelLayout(data) {
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
}
else if (labelPosition === 'right') {
// Right side
x1 = (points[1][0] + points[2][0]) / 2;
......@@ -112,7 +112,7 @@ function labelLayout(data) {
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'left';
}
}
else if (labelPosition === 'rightTop') {
// RightTop side
x1 = points[1][0];
......@@ -120,7 +120,7 @@ function labelLayout(data) {
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'top';
}
}
else if (labelPosition === 'rightBottom') {
// RightBottom side
x1 = points[2][0];
......@@ -128,7 +128,7 @@ function labelLayout(data) {
x2 = x1 + labelLineLen;
textX = x2 + 5;
textAlign = 'bottom';
}
}
else if (labelPosition === 'leftTop') {
// LeftTop side
x1 = points[0][0];
......@@ -136,7 +136,7 @@ function labelLayout(data) {
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
}
else if (labelPosition === 'leftBottom') {
// LeftBottom side
x1 = points[3][0];
......@@ -144,7 +144,7 @@ function labelLayout(data) {
x2 = x1 - labelLineLen;
textX = x2 - 5;
textAlign = 'right';
}
}
else {
// Right side
x1 = (points[1][0] + points[2][0]) / 2;
......
......@@ -787,11 +787,11 @@ export default ChartView.extend({
}
});
this._polyline
= this._polygon
= this._coordSys
= this._points
= this._stackedOnPoints
= this._data = null;
this._polyline =
this._polygon =
this._coordSys =
this._points =
this._stackedOnPoints =
this._data = null;
}
});
\ No newline at end of file
......@@ -141,7 +141,8 @@ piePieceProto.updateData = function (data, idx, firstCreate) {
if (animationTypeUpdate === 'expansion') {
// Sectors are set to be target shape and an overlaying clipPath is used for animation
sector.setShape(sectorShape);
} else {
}
else {
// Transition animation from the old shape
graphic.updateProps(sector, {
shape: sectorShape
......
......@@ -292,7 +292,8 @@ SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) {
else if (rotate < -Math.PI / 2) {
rotate += Math.PI;
}
} else if (typeof rotateType === 'number') {
}
else if (typeof rotateType === 'number') {
rotate = rotateType * Math.PI / 180;
}
label.attr('rotation', rotate);
......
......@@ -21,7 +21,7 @@
import { parsePercent } from '../../util/number';
import * as zrUtil from 'zrender/src/core/util';
var PI2 = Math.PI * 2;
// var PI2 = Math.PI * 2;
var RADIAN = Math.PI / 180;
export default function (seriesType, ecModel, api, payload) {
......@@ -74,8 +74,8 @@ export default function (seriesType, ecModel, api, payload) {
var stillShowZeroSum = seriesModel.get('stillShowZeroSum');
// In the case some sector angle is smaller than minAngle
var restAngle = PI2;
var valueSumLargerThanMinAngle = 0;
// var restAngle = PI2;
// var valueSumLargerThanMinAngle = 0;
var dir = clockwise ? 1 : -1;
......@@ -99,11 +99,11 @@ export default function (seriesType, ecModel, api, payload) {
? unitRadian : (value * unitRadian);
if (angle < minAngle) {
angle = minAngle;
restAngle -= minAngle;
}
else {
valueSumLargerThanMinAngle += value;
// restAngle -= minAngle;
}
// else {
// valueSumLargerThanMinAngle += value;
// }
endAngle = startAngle + dir * angle;
......
......@@ -51,8 +51,8 @@ echarts.registerPreprocessor(function (option) {
echarts.registerProcessor(echarts.PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) {
// Build axisPointerModel, mergin tooltip.axisPointer model for each axis.
// allAxesInfo should be updated when setOption performed.
ecModel.getComponent('axisPointer').coordSysAxesInfo
= axisPointerModelHelper.collect(ecModel, api);
ecModel.getComponent('axisPointer').coordSysAxesInfo =
axisPointerModelHelper.collect(ecModel, api);
});
// Broadcast to all views.
......
......@@ -128,8 +128,8 @@ BaseAxisPointer.prototype = {
}
this._lastGraphicKey = graphicKey;
var moveAnimation = this._moveAnimation
= this.determineAnimation(axisModel, axisPointerModel);
var moveAnimation = this._moveAnimation =
this.determineAnimation(axisModel, axisPointerModel);
if (!group) {
group = this._group = new graphic.Group();
......
......@@ -382,9 +382,9 @@ var DataZoomModel = echarts.extendComponentModel({
}
if (this._autoThrottle) {
var globalOption = this.ecModel.option;
this.option.throttle
= (globalOption.animation && globalOption.animationDurationUpdate > 0)
? 100 : 20;
this.option.throttle = (
globalOption.animation && globalOption.animationDurationUpdate > 0
) ? 100 : 20;
}
},
......
......@@ -402,7 +402,7 @@ echarts.extendComponentView({
};
// PENDING
// Currently, when `bounding: 'all'`, the union bounding rect of the group
// Currently, when `bounding: 'all'`, the union bounding rect of the group
// does not include the rect of [0, 0, group.width, group.height], which
// is probably weird for users. Should we make a break change for it?
layoutUtil.positionElement(
......
......@@ -185,7 +185,8 @@ export default echarts.extendComponentView({
path.setStyle({
text: titles[iconName],
textPosition: iconStyleEmphasisModel.get('textPosition') || 'bottom',
textFill: iconStyleEmphasisModel.get('textFill') || hoverStyle.fill || hoverStyle.stroke || '#000',
textFill: iconStyleEmphasisModel.get('textFill')
|| hoverStyle.fill || hoverStyle.stroke || '#000',
textAlign: iconStyleEmphasisModel.get('textAlign') || 'center',
textBackgroundColor: iconStyleEmphasisModel.get('textBackgroundColor'),
textBorderRadius: iconStyleEmphasisModel.get('textBorderRadius'),
......
......@@ -57,9 +57,8 @@ export function layout(axisModel, opt) {
var directionMap = {top: -1, bottom: 1, right: 1, left: -1};
layout.labelDirection = layout.tickDirection
= layout.nameDirection
= directionMap[axisPosition];
layout.labelDirection = layout.tickDirection =
layout.nameDirection = directionMap[axisPosition];
if (axisModel.get('axisTick.inside')) {
layout.tickDirection = -layout.tickDirection;
......
......@@ -153,8 +153,8 @@ function completeDimensions(sysDims, source, opt) {
// `coordDimIndex` should not be set directly.
sysDimItemDimsDef = sysDimItem.dimsDef;
sysDimItemOtherDims = sysDimItem.otherDims;
sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex
= sysDimItem.dimsDef = sysDimItem.otherDims = null;
sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex =
sysDimItem.dimsDef = sysDimItem.otherDims = null;
}
var dataDims = encodeDef.get(coordDim);
......
......@@ -63,8 +63,7 @@ function barLayoutPolar(seriesType, ecModel, api) {
var axisKey = getAxisKey(polar, baseAxis);
var stackId = getSeriesStackId(seriesModel);
var columnLayoutInfo
= barWidthAndOffset[axisKey][stackId];
var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];
var columnOffset = columnLayoutInfo.offset;
var columnWidth = columnLayoutInfo.width;
var valueAxis = polar.getOtherAxis(baseAxis);
......
......@@ -34,7 +34,7 @@ var getLineStyle = makeStyleMapper(
export default {
getLineStyle: function (excludes) {
var style = getLineStyle(this, excludes);
// Always set lineDash whether dashed, otherwise we can not
// Always set lineDash whether dashed, otherwise we can not
// erase the previous style when assigning to el.style.
style.lineDash = this.getLineDash(style.lineWidth);
return style;
......@@ -47,15 +47,15 @@ export default {
var lineType = this.get('type');
var dotSize = Math.max(lineWidth, 2);
var dashSize = lineWidth * 4;
return (lineType === 'solid' || lineType == null)
// Use `false` but not `null` for the solid line here, because `null` might be
// ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as
// `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the
// `lineDash` gotten form the latter one is not able to erase that from the former
return (lineType === 'solid' || lineType == null)
// Use `false` but not `null` for the solid line here, because `null` might be
// ignored when assigning to `el.style`. e.g., when setting `lineStyle.type` as
// `'dashed'` and `emphasis.lineStyle.type` as `'solid'` in graph series, the
// `lineDash` gotten form the latter one is not able to erase that from the former
// one if using `null` here according to the emhpsis strategy in `util/graphic.js`.
? false
: lineType === 'dashed'
? [dashSize, dashSize]
: lineType === 'dashed'
? [dashSize, dashSize]
: [dotSize, dotSize];
}
};
\ No newline at end of file
......@@ -57,10 +57,10 @@ Component.prototype = {
};
var componentProto = Component.prototype;
componentProto.updateView
= componentProto.updateLayout
= componentProto.updateVisual
= function (seriesModel, ecModel, api, payload) {
componentProto.updateView =
componentProto.updateLayout =
componentProto.updateVisual =
function (seriesModel, ecModel, api, payload) {
// Do nothing;
};
// Enable Component.extend.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册