This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch release in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit e80a9a6fd89deadc315cabe290b075568f6928ba Author: sushuang <[email protected]> AuthorDate: Fri Sep 14 13:50:28 2018 +0800 just fix lint... --- .eslintrc.yaml | 2 +- src/chart/bar/PictorialBarView.js | 4 +-- src/chart/candlestick/candlestickLayout.js | 2 ++ src/chart/chord/chordCircularLayout.js | 4 +-- src/chart/funnel/FunnelView.js | 2 +- src/chart/funnel/funnelLayout.js | 3 +- src/chart/graph/adjustEdge.js | 8 ++--- src/chart/heatmap/HeatmapLayer.js | 8 +++-- src/chart/helper/LargeSymbolDraw.js | 2 ++ src/chart/helper/Line.js | 2 +- src/chart/helper/whiskerBoxCommon.js | 2 +- src/chart/line/LineView.js | 12 ++++---- src/chart/line/poly.js | 16 +++++++--- src/chart/lines/LinesSeries.js | 6 +++- src/chart/lines/linesLayout.js | 2 ++ src/chart/parallel/ParallelView.js | 1 - src/chart/sankey/sankeyLayout.js | 16 ++++++---- src/chart/sankey/sankeyVisual.js | 4 +-- src/chart/treemap/treemapLayout.js | 2 +- src/chart/treemap/treemapVisual.js | 3 +- src/component/axis/AngleAxisView.js | 6 ++-- src/component/axis/RadiusAxisView.js | 2 +- src/component/axis/SingleAxisView.js | 4 +-- src/component/axisPointer/AxisPointerModel.js | 2 ++ src/component/axisPointer/BaseAxisPointer.js | 6 ++-- src/component/axisPointer/viewHelper.js | 2 +- src/component/brush/BrushModel.js | 6 ++-- src/component/dataZoom/DataZoomModel.js | 4 +-- src/component/dataZoom/SliderZoomModel.js | 2 ++ src/component/dataZoom/SliderZoomView.js | 2 +- src/component/helper/listComponent.js | 2 +- src/component/marker/MarkAreaView.js | 6 ++-- src/component/marker/MarkLineView.js | 24 ++++++++++----- src/component/marker/MarkPointView.js | 2 +- src/component/parallel.js | 2 +- src/component/toolbox/ToolboxView.js | 2 +- src/component/toolbox/feature/Brush.js | 4 +++ src/component/toolbox/feature/DataView.js | 2 +- src/component/toolbox/feature/DataZoom.js | 4 +-- src/component/toolbox/feature/MagicType.js | 4 ++- src/component/toolbox/feature/Restore.js | 2 ++ src/component/toolbox/feature/SaveAsImage.js | 12 ++++---- src/component/tooltip/TooltipView.js | 10 +++---- src/component/visualMap/ContinuousModel.js | 26 ++++++++--------- src/component/visualMap/VisualMapModel.js | 2 +- src/coord/axisDefault.js | 2 +- src/coord/axisModelCommonMixin.js | 2 +- src/coord/calendar/Calendar.js | 6 ++-- src/coord/cartesian/cartesianAxisHelper.js | 4 +-- src/coord/geo/Region.js | 2 +- src/coord/geo/fix/nanhai.js | 28 +++++++++--------- src/coord/geo/fix/textCoord.js | 2 +- src/coord/radar/RadarModel.js | 2 +- src/coord/single/Single.js | 2 +- src/coord/single/singleCreator.js | 2 +- src/data/Graph.js | 7 +++-- src/data/List.js | 16 ++++++---- src/data/Tree.js | 2 +- src/data/helper/sourceHelper.js | 3 +- src/layout/barGrid.js | 2 ++ src/layout/barPolar.js | 4 +-- src/layout/points.js | 2 ++ src/model/Model.js | 2 +- src/model/globalDefault.js | 5 +++- src/scale/Time.js | 2 +- src/stream/Scheduler.js | 6 ++-- src/theme/dark.js | 5 +++- src/theme/light.js | 5 +++- src/util/format.js | 6 ++-- src/util/graphic.js | 2 +- src/util/number.js | 42 ++++++++++++++++++++------- src/util/quickSelect.js | 2 +- src/visual/symbol.js | 4 +-- src/visual/visualSolution.js | 2 +- theme/dark.js | 7 ++++- 75 files changed, 256 insertions(+), 163 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 2124f62..7d18fe3 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -143,7 +143,7 @@ rules: max-nested-callbacks: - 1 - - 3 + - 5 max-depth: - 1 - 6 diff --git a/src/chart/bar/PictorialBarView.js b/src/chart/bar/PictorialBarView.js index 730f1bc..0ac9a31 100644 --- a/src/chart/bar/PictorialBarView.js +++ b/src/chart/bar/PictorialBarView.js @@ -629,12 +629,12 @@ function updateHoverAnimation(path, symbolMeta) { var scale = symbolMeta.symbolScale.slice(); symbolMeta.hoverAnimation && path - .on('emphasis', function() { + .on('emphasis', function () { this.animateTo({ scale: [scale[0] * 1.1, scale[1] * 1.1] }, 400, 'elasticOut'); }) - .on('normal', function() { + .on('normal', function () { this.animateTo({ scale: scale.slice() }, 400, 'elasticOut'); diff --git a/src/chart/candlestick/candlestickLayout.js b/src/chart/candlestick/candlestickLayout.js index 27b1a37..85a4970 100644 --- a/src/chart/candlestick/candlestickLayout.js +++ b/src/chart/candlestick/candlestickLayout.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float32Array */ + import {subPixelOptimize} from '../../util/graphic'; import createRenderPlanner from '../helper/createRenderPlanner'; import {parsePercent} from '../../util/number'; diff --git a/src/chart/chord/chordCircularLayout.js b/src/chart/chord/chordCircularLayout.js index 39dda92..0cb2b27 100644 --- a/src/chart/chord/chordCircularLayout.js +++ b/src/chart/chord/chordCircularLayout.js @@ -63,7 +63,7 @@ function layout(graphs, opts) { return sumSize + group.size; }, 0); - if (opts.sort && opts.sort != 'none') { + if (opts.sort && opts.sort !== 'none') { groups.sort(compareGroups); if (opts.sort === 'descending') { groups.reverse(); @@ -74,7 +74,7 @@ function layout(graphs, opts) { var angle = opts.startAngle * Math.PI / 180; var sign = opts.clockwise ? -1 : 1; zrUtil.each(groups, function (group) { - if (opts.sortSub && opts.sortSub != 'none') { + if (opts.sortSub && opts.sortSub !== 'none') { group.subGroups.sort(compareGroups); if (opts.sortSub === 'descending') { group.subGroups.reverse(); diff --git a/src/chart/funnel/FunnelView.js b/src/chart/funnel/FunnelView.js index e1a9eb3..c9a3f47 100644 --- a/src/chart/funnel/FunnelView.js +++ b/src/chart/funnel/FunnelView.js @@ -74,7 +74,7 @@ funnelPieceProto.updateData = function (data, idx, firstCreate) { polygon.setShape({ points: layout.points }); - polygon.setStyle({ opacity : 0 }); + polygon.setStyle({opacity: 0}); graphic.initProps(polygon, { style: { opacity: opacity diff --git a/src/chart/funnel/funnelLayout.js b/src/chart/funnel/funnelLayout.js index b1dab31..b4f91ac 100644 --- a/src/chart/funnel/funnelLayout.js +++ b/src/chart/funnel/funnelLayout.js @@ -43,7 +43,8 @@ function getSortedIndices(data, sort) { // Add custom sortable function & none sortable opetion by "options.sort" if (typeof sort === 'function') { indices.sort(sort); - } else if (sort !== 'none') { + } + else if (sort !== 'none') { indices.sort(function (a, b) { return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; }); diff --git a/src/chart/graph/adjustEdge.js b/src/chart/graph/adjustEdge.js index 0fe6d09..d36a0a6 100644 --- a/src/chart/graph/adjustEdge.js +++ b/src/chart/graph/adjustEdge.js @@ -124,7 +124,7 @@ export default function (graph, scale) { vec2.copy(pts[0], originalPoints[0]); vec2.copy(pts[1], originalPoints[2]); vec2.copy(pts[2], originalPoints[1]); - if (fromSymbol && fromSymbol != 'none') { + if (fromSymbol && fromSymbol !== 'none') { var symbolSize = getSymbolSize(edge.node1); var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale); @@ -136,7 +136,7 @@ export default function (graph, scale) { pts[0][1] = tmp0[3]; pts[1][1] = tmp0[4]; } - if (toSymbol && toSymbol != 'none') { + if (toSymbol && toSymbol !== 'none') { var symbolSize = getSymbolSize(edge.node2); var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale); @@ -160,13 +160,13 @@ export default function (graph, scale) { vec2.sub(v, pts2[1], pts2[0]); vec2.normalize(v, v); - if (fromSymbol && fromSymbol != 'none') { + if (fromSymbol && fromSymbol !== 'none') { var symbolSize = getSymbolSize(edge.node1); vec2.scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale); } - if (toSymbol && toSymbol != 'none') { + if (toSymbol && toSymbol !== 'none') { var symbolSize = getSymbolSize(edge.node2); vec2.scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale); diff --git a/src/chart/heatmap/HeatmapLayer.js b/src/chart/heatmap/HeatmapLayer.js index 78da0e5..abaef3c 100644 --- a/src/chart/heatmap/HeatmapLayer.js +++ b/src/chart/heatmap/HeatmapLayer.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Uint8ClampedArray */ + /** * @file defines echarts Heatmap Chart * @author Ovilia ([email protected]) @@ -54,7 +56,7 @@ Heatmap.prototype = { * @param {number} width canvas width * @param {number} height canvas height */ - update: function(data, width, height, normalize, colorFunc, isInRange) { + update: function (data, width, height, normalize, colorFunc, isInRange) { var brush = this._getBrush(); var gradientInRange = this._getGradient(data, colorFunc, 'inRange'); var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange'); @@ -95,7 +97,7 @@ Heatmap.prototype = { var maxOpacity = this.maxOpacity; var diffOpacity = maxOpacity - minOpacity; - while(offset < pixelLen) { + while (offset < pixelLen) { var alpha = pixels[offset + 3] / 256; var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4; // Simple optimize to ignore the empty data @@ -122,7 +124,7 @@ Heatmap.prototype = { * @private * @returns {Object} circle brush canvas */ - _getBrush: function() { + _getBrush: function () { var brushCanvas = this._brushCanvas || (this._brushCanvas = zrUtil.createCanvas()); // set brush size var r = this.pointSize + this.blurSize; diff --git a/src/chart/helper/LargeSymbolDraw.js b/src/chart/helper/LargeSymbolDraw.js index c63936d..a5ad194 100644 --- a/src/chart/helper/LargeSymbolDraw.js +++ b/src/chart/helper/LargeSymbolDraw.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float32Array */ + // TODO Batch by color import * as graphic from '../../util/graphic'; diff --git a/src/chart/helper/Line.js b/src/chart/helper/Line.js index 40351b1..726061c 100644 --- a/src/chart/helper/Line.js +++ b/src/chart/helper/Line.js @@ -86,7 +86,7 @@ function setLinePoints(targetShape, points) { } } -function updateSymbolAndLabelBeforeLineUpdate () { +function updateSymbolAndLabelBeforeLineUpdate() { var lineGroup = this; var symbolFrom = lineGroup.childOfName('fromSymbol'); var symbolTo = lineGroup.childOfName('toSymbol'); diff --git a/src/chart/helper/whiskerBoxCommon.js b/src/chart/helper/whiskerBoxCommon.js index f09e3f8..9d8643a 100644 --- a/src/chart/helper/whiskerBoxCommon.js +++ b/src/chart/helper/whiskerBoxCommon.js @@ -54,7 +54,7 @@ export var seriesModelMixin = { ordinalMeta = xAxisModel.getOrdinalMeta(); addOrdinal = true; } - else if (yAxisType === 'category') { + else if (yAxisType === 'category') { option.layout = 'vertical'; ordinalMeta = yAxisModel.getOrdinalMeta(); addOrdinal = true; diff --git a/src/chart/line/LineView.js b/src/chart/line/LineView.js index 33ad56a..501f026 100644 --- a/src/chart/line/LineView.js +++ b/src/chart/line/LineView.js @@ -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 diff --git a/src/chart/line/poly.js b/src/chart/line/poly.js index 9a53ebc..df50c24 100644 --- a/src/chart/line/poly.js +++ b/src/chart/line/poly.js @@ -267,10 +267,18 @@ function getBoundingBox(points, smoothConstraint) { if (smoothConstraint) { for (var i = 0; i < points.length; i++) { var pt = points[i]; - if (pt[0] < ptMin[0]) { ptMin[0] = pt[0]; } - if (pt[1] < ptMin[1]) { ptMin[1] = pt[1]; } - if (pt[0] > ptMax[0]) { ptMax[0] = pt[0]; } - if (pt[1] > ptMax[1]) { ptMax[1] = pt[1]; } + if (pt[0] < ptMin[0]) { + ptMin[0] = pt[0]; + } + if (pt[1] < ptMin[1]) { + ptMin[1] = pt[1]; + } + if (pt[0] > ptMax[0]) { + ptMax[0] = pt[0]; + } + if (pt[1] > ptMax[1]) { + ptMax[1] = pt[1]; + } } } return { diff --git a/src/chart/lines/LinesSeries.js b/src/chart/lines/LinesSeries.js index 0066987..59747be 100644 --- a/src/chart/lines/LinesSeries.js +++ b/src/chart/lines/LinesSeries.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Uint32Array, Float64Array, Float32Array */ + import {__DEV__} from '../../config'; import SeriesModel from '../../model/Series'; import List from '../../data/List'; @@ -120,7 +122,9 @@ var LinesSeries = SeriesModel.extend({ if (__DEV__) { if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { - throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); + throw new Error( + 'Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.' + ); } } return coords; diff --git a/src/chart/lines/linesLayout.js b/src/chart/lines/linesLayout.js index f54fb18..12a8a64 100644 --- a/src/chart/lines/linesLayout.js +++ b/src/chart/lines/linesLayout.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float32Array */ + import createRenderPlanner from '../helper/createRenderPlanner'; export default { diff --git a/src/chart/parallel/ParallelView.js b/src/chart/parallel/ParallelView.js index c2232b9..46a60e6 100644 --- a/src/chart/parallel/ParallelView.js +++ b/src/chart/parallel/ParallelView.js @@ -18,7 +18,6 @@ */ import * as graphic from '../../util/graphic'; -import * as zrUtil from 'zrender/src/core/util'; import ChartView from '../../view/Chart'; var DEFAULT_SMOOTH = 0.3; diff --git a/src/chart/sankey/sankeyLayout.js b/src/chart/sankey/sankeyLayout.js index 05add6d..ef77ff0 100644 --- a/src/chart/sankey/sankeyLayout.js +++ b/src/chart/sankey/sankeyLayout.js @@ -134,7 +134,8 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) { } while (zeroIndegrees.length) { - zrUtil.each(zeroIndegrees, function (node) { + for (var idx = 0; idx < zeroIndegrees.length; idx++) { + var node = zeroIndegrees[idx]; if (orient === 'vertical') { node.setLayout({y: x}, true); node.setLayout({dy: nodeWidth}, true); @@ -143,7 +144,8 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) { node.setLayout({x: x}, true); node.setLayout({dx: nodeWidth}, true); } - zrUtil.each(node.outEdges, function (edge) { + for (var oidx = 0; oidx < node.outEdges.length; oidx++) { + var edge = node.outEdges[oidx]; var indexEdge = edges.indexOf(edge); remainEdges[indexEdge] = 0; var targetNode = edge.node2; @@ -151,8 +153,8 @@ function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient) { if (--indegreeArr[nodeIndex] === 0) { nextNode.push(targetNode); } - }); - }); + } + } ++x; zeroIndegrees = nextNode; nextNode = []; @@ -334,6 +336,7 @@ function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { var i; if (orient === 'vertical') { + var nodeX; nodes.sort(function (a, b) { return a.getLayout().x - b.getLayout().x; }); @@ -341,7 +344,7 @@ function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { node = nodes[i]; dy = y0 - node.getLayout().x; if (dy > 0) { - var nodeX = node.getLayout().x + dy; + nodeX = node.getLayout().x + dy; node.setLayout({x: nodeX}, true); } y0 = node.getLayout().x + node.getLayout().dx + nodeGap; @@ -364,6 +367,7 @@ function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { } } else { + var nodeY; nodes.sort(function (a, b) { return a.getLayout().y - b.getLayout().y; }); @@ -371,7 +375,7 @@ function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) { node = nodes[i]; dy = y0 - node.getLayout().y; if (dy > 0) { - var nodeY = node.getLayout().y + dy; + nodeY = node.getLayout().y + dy; node.setLayout({y: nodeY}, true); } y0 = node.getLayout().y + node.getLayout().dy + nodeGap; diff --git a/src/chart/sankey/sankeyVisual.js b/src/chart/sankey/sankeyVisual.js index a0706f6..8c2ad6f 100644 --- a/src/chart/sankey/sankeyVisual.js +++ b/src/chart/sankey/sankeyVisual.js @@ -41,7 +41,7 @@ export default function (ecModel, payload) { maxValue = nodeValue; } }); - + zrUtil.each(nodes, function (node) { var mapping = new VisualMapping({ type: 'color', @@ -49,7 +49,7 @@ export default function (ecModel, payload) { dataExtent: [minValue, maxValue], visual: seriesModel.get('color') }); - + var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value); node.setVisual('color', mapValueToColor); // If set itemStyle.normal.color diff --git a/src/chart/treemap/treemapLayout.js b/src/chart/treemap/treemapLayout.js index 5fb3940..c72909c 100644 --- a/src/chart/treemap/treemapLayout.js +++ b/src/chart/treemap/treemapLayout.js @@ -339,7 +339,7 @@ function sort(viewChildren, orderBy) { if (orderBy) { viewChildren.sort(function (a, b) { var diff = orderBy === 'asc' - ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); + ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); return diff === 0 ? (orderBy === 'asc' ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex diff --git a/src/chart/treemap/treemapVisual.js b/src/chart/treemap/treemapVisual.js index 235b839..560f510 100644 --- a/src/chart/treemap/treemapVisual.js +++ b/src/chart/treemap/treemapVisual.js @@ -227,8 +227,7 @@ function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) { if (mapping) { var mappingType = mapping.type; var colorMappingBy = mappingType === 'color' && mapping.__drColorMappingBy; - var value = - colorMappingBy === 'index' + var value = colorMappingBy === 'index' ? index : colorMappingBy === 'id' ? seriesModel.mapIdToIndex(child.getId()) diff --git a/src/component/axis/AngleAxisView.js b/src/component/axis/AngleAxisView.js index b8da3fe..ae9cfc7 100644 --- a/src/component/axis/AngleAxisView.js +++ b/src/component/axis/AngleAxisView.js @@ -81,7 +81,7 @@ export default AxisView.extend({ fixAngleOverlap(ticksAngles); zrUtil.each(elementList, function (name) { - if (angleAxisModel.get(name +'.show') + if (angleAxisModel.get(name + '.show') && (!angleAxis.scale.isBlank() || name === 'axisLine') ) { this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels); @@ -162,7 +162,9 @@ export default AxisView.extend({ ? 'middle' : (p[1] > cy ? 'top' : 'bottom'); if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { - labelModel = new Model(rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel); + labelModel = new Model( + rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel + ); } var textEl = new graphic.Text({silent: true}); diff --git a/src/component/axis/RadiusAxisView.js b/src/component/axis/RadiusAxisView.js index f884c64..7d9a136 100644 --- a/src/component/axis/RadiusAxisView.js +++ b/src/component/axis/RadiusAxisView.js @@ -53,7 +53,7 @@ export default AxisView.extend({ this.group.add(axisBuilder.getGroup()); zrUtil.each(selfBuilderAttrs, function (name) { - if (radiusAxisModel.get(name +'.show') && !radiusAxis.scale.isBlank()) { + if (radiusAxisModel.get(name + '.show') && !radiusAxis.scale.isBlank()) { this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords); } }, this); diff --git a/src/component/axis/SingleAxisView.js b/src/component/axis/SingleAxisView.js index d7ac227..00c2cd8 100644 --- a/src/component/axis/SingleAxisView.js +++ b/src/component/axis/SingleAxisView.js @@ -42,7 +42,7 @@ var SingleAxisView = AxisView.extend({ group.removeAll(); - var layout = singleAxisHelper.layout(axisModel); + var layout = singleAxisHelper.layout(axisModel); var axisBuilder = new AxisBuilder(axisModel, layout); @@ -57,7 +57,7 @@ var SingleAxisView = AxisView.extend({ SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); }, - _splitLine: function(axisModel) { + _splitLine: function (axisModel) { var axis = axisModel.axis; if (axis.scale.isBlank()) { diff --git a/src/component/axisPointer/AxisPointerModel.js b/src/component/axisPointer/AxisPointerModel.js index 47a82fd..3ce3b99 100644 --- a/src/component/axisPointer/AxisPointerModel.js +++ b/src/component/axisPointer/AxisPointerModel.js @@ -91,7 +91,9 @@ var AxisPointerModel = echarts.extendComponentModel({ handle: { show: false, + /* eslint-disable */ icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line + /* eslint-enable */ size: 45, // handle margin is from symbol center to axis, which is stable when circular move. margin: 50, diff --git a/src/component/axisPointer/BaseAxisPointer.js b/src/component/axisPointer/BaseAxisPointer.js index 5beab29..3d564aa 100644 --- a/src/component/axisPointer/BaseAxisPointer.js +++ b/src/component/axisPointer/BaseAxisPointer.js @@ -33,7 +33,7 @@ var bind = zrUtil.bind; * Base axis pointer class in 2D. * Implemenents {module:echarts/component/axis/IAxisPointer}. */ -function BaseAxisPointer () { +function BaseAxisPointer() { } BaseAxisPointer.prototype = { @@ -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(); diff --git a/src/component/axisPointer/viewHelper.js b/src/component/axisPointer/viewHelper.js index b019890..a8d76a9 100644 --- a/src/component/axisPointer/viewHelper.js +++ b/src/component/axisPointer/viewHelper.js @@ -164,7 +164,7 @@ export function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { * rotation, position, labelOffset, labelDirection, labelMargin * } */ -export function getTransformedPosition (axis, value, layoutInfo) { +export function getTransformedPosition(axis, value, layoutInfo) { var transform = matrix.create(); matrix.rotate(transform, transform, layoutInfo.rotation); matrix.translate(transform, transform, layoutInfo.position); diff --git a/src/component/brush/BrushModel.js b/src/component/brush/BrushModel.js index a31087a..85da245 100644 --- a/src/component/brush/BrushModel.js +++ b/src/component/brush/BrushModel.js @@ -54,9 +54,9 @@ var BrushModel = echarts.extendComponentModel({ borderColor: 'rgba(120,140,180,0.8)' }, - throttleType: 'fixRate',// Throttle in brushSelected event. 'fixRate' or 'debounce'. - // If null, no throttle. Valid only in the first brush component - throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. + throttleType: 'fixRate', // Throttle in brushSelected event. 'fixRate' or 'debounce'. + // If null, no throttle. Valid only in the first brush component + throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. // FIXME // 试验效果 diff --git a/src/component/dataZoom/DataZoomModel.js b/src/component/dataZoom/DataZoomModel.js index b73d43b..9c5f6a5 100644 --- a/src/component/dataZoom/DataZoomModel.js +++ b/src/component/dataZoom/DataZoomModel.js @@ -382,8 +382,8 @@ var DataZoomModel = echarts.extendComponentModel({ } if (this._autoThrottle) { var globalOption = this.ecModel.option; - this.option.throttle = - (globalOption.animation && globalOption.animationDurationUpdate > 0) + this.option.throttle + = (globalOption.animation && globalOption.animationDurationUpdate > 0) ? 100 : 20; } }, diff --git a/src/component/dataZoom/SliderZoomModel.js b/src/component/dataZoom/SliderZoomModel.js index 53b5954..54d0f19 100644 --- a/src/component/dataZoom/SliderZoomModel.js +++ b/src/component/dataZoom/SliderZoomModel.js @@ -62,7 +62,9 @@ var SliderZoomModel = DataZoomModel.extend({ fillerColor: 'rgba(167,183,204,0.4)', // Color of selected area. // handleColor: 'rgba(89,170,216,0.95)', // Color of handle. // handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z', + /* eslint-disable */ handleIcon: 'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z', + /* eslint-enable */ // Percent of the slider height handleSize: '100%', diff --git a/src/component/dataZoom/SliderZoomView.js b/src/component/dataZoom/SliderZoomView.js index fbe1028..e0566a3 100644 --- a/src/component/dataZoom/SliderZoomView.js +++ b/src/component/dataZoom/SliderZoomView.js @@ -460,7 +460,7 @@ var SliderZoomView = DataZoomView.extend({ onmouseout: bind(this._showDataInfo, this, false), style: { fill: dataZoomModel.get('fillerColor'), - textPosition : 'inside' + textPosition: 'inside' } })); diff --git a/src/component/helper/listComponent.js b/src/component/helper/listComponent.js index 8836109..91098b1 100644 --- a/src/component/helper/listComponent.js +++ b/src/component/helper/listComponent.js @@ -21,7 +21,7 @@ import { getLayoutRect, box as layoutBox, positionElement -} from '../../util/layout'; +} from '../../util/layout'; import * as formatUtil from '../../util/format'; import * as graphic from '../../util/graphic'; diff --git a/src/component/marker/MarkAreaView.js b/src/component/marker/MarkAreaView.js index 81079f6..ec1ae7b 100644 --- a/src/component/marker/MarkAreaView.js +++ b/src/component/marker/MarkAreaView.js @@ -76,8 +76,8 @@ function markAreaFilter(coordSys, item) { // } // } if ( - fromCoord && toCoord && - (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) + fromCoord && toCoord + && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) ) { return true; @@ -312,7 +312,7 @@ function createList(coordSys, seriesModel, maModel) { }), maModel); } else { - coordDimsInfos =[{ + coordDimsInfos = [{ name: 'value', type: 'float' }]; diff --git a/src/component/marker/MarkLineView.js b/src/component/marker/MarkLineView.js index 39ddc32..d08cf32 100644 --- a/src/component/marker/MarkLineView.js +++ b/src/component/marker/MarkLineView.js @@ -122,8 +122,8 @@ function markLineFilter(coordSys, item) { // } // } if ( - fromCoord && toCoord && - (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) + fromCoord && toCoord + && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) ) { return true; @@ -352,7 +352,7 @@ function createList(coordSys, seriesModel, mlModel) { }); } else { - coordDimsInfos =[{ + coordDimsInfos = [{ name: 'value', type: 'float' }]; @@ -375,15 +375,23 @@ function createList(coordSys, seriesModel, mlModel) { return item.value; }; fromData.initData( - zrUtil.map(optData, function (item) { return item[0]; }), - null, dimValueGetter + zrUtil.map(optData, function (item) { + return item[0]; + }), + null, + dimValueGetter ); toData.initData( - zrUtil.map(optData, function (item) { return item[1]; }), - null, dimValueGetter + zrUtil.map(optData, function (item) { + return item[1]; + }), + null, + dimValueGetter ); lineData.initData( - zrUtil.map(optData, function (item) { return item[2]; }) + zrUtil.map(optData, function (item) { + return item[2]; + }) ); lineData.hasItemOption = true; diff --git a/src/component/marker/MarkPointView.js b/src/component/marker/MarkPointView.js index b7331b9..ba6982a 100644 --- a/src/component/marker/MarkPointView.js +++ b/src/component/marker/MarkPointView.js @@ -153,7 +153,7 @@ function createList(coordSys, seriesModel, mpModel) { }); } else { - coordDimsInfos =[{ + coordDimsInfos = [{ name: 'value', type: 'float' }]; diff --git a/src/component/parallel.js b/src/component/parallel.js index 1466316..fffa8ae 100644 --- a/src/component/parallel.js +++ b/src/component/parallel.js @@ -123,7 +123,7 @@ var handlers = { : { axisExpandWindow: result.axisExpandWindow, // Jumping uses animation, and sliding suppresses animation. - animation: behavior === 'jump' ? null : false + animation: behavior === 'jump' ? null : false } ); } diff --git a/src/component/toolbox/ToolboxView.js b/src/component/toolbox/ToolboxView.js index d55b8d1..1f99178 100644 --- a/src/component/toolbox/ToolboxView.js +++ b/src/component/toolbox/ToolboxView.js @@ -211,7 +211,7 @@ export default echarts.extendComponentView({ needPutOnTop = true; } var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8); - if (offsetX + rect.width / 2 > api.getWidth()) { + if (offsetX + rect.width / 2 > api.getWidth()) { hoverStyle.textPosition = ['100%', topOffset]; hoverStyle.textAlign = 'right'; } diff --git a/src/component/toolbox/feature/Brush.js b/src/component/toolbox/feature/Brush.js index 89b0b36..16b2a49 100644 --- a/src/component/toolbox/feature/Brush.js +++ b/src/component/toolbox/feature/Brush.js @@ -45,12 +45,14 @@ Brush.defaultOption = { show: true, type: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'], icon: { + /* eslint-disable */ rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13', // jshint ignore:line polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2', // jshint ignore:line lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4', // jshint ignore:line lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4', // jshint ignore:line keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line + /* eslint-enable */ }, // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` title: zrUtil.clone(brushLang.title) @@ -59,7 +61,9 @@ Brush.defaultOption = { var proto = Brush.prototype; // proto.updateLayout = function (featureModel, ecModel, api) { +/* eslint-disable */ proto.render = +/* eslint-enable */ proto.updateView = function (featureModel, ecModel, api) { var brushType; var brushMode; diff --git a/src/component/toolbox/feature/DataView.js b/src/component/toolbox/feature/DataView.js index d551943..613e5aa 100644 --- a/src/component/toolbox/feature/DataView.js +++ b/src/component/toolbox/feature/DataView.js @@ -108,7 +108,7 @@ function assembleSeriesWithCategoryAxis(series) { } tables.push(lines.join('\n')); }); - return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); + return tables.join('\n\n' + BLOCK_SPLITER + '\n\n'); } /** diff --git a/src/component/toolbox/feature/DataZoom.js b/src/component/toolbox/feature/DataZoom.js index 7bfc287..84a9170 100644 --- a/src/component/toolbox/feature/DataZoom.js +++ b/src/component/toolbox/feature/DataZoom.js @@ -286,7 +286,7 @@ echarts.registerPreprocessor(function (option) { var axisIndicesName = axisName + 'Index'; var givenAxisIndices = dataZoomOpt[axisIndicesName]; if (givenAxisIndices != null - && givenAxisIndices != 'all' + && givenAxisIndices !== 'all' && !zrUtil.isArray(givenAxisIndices) ) { givenAxisIndices = (givenAxisIndices === false || givenAxisIndices === 'none') ? [] : [givenAxisIndices]; @@ -294,7 +294,7 @@ echarts.registerPreprocessor(function (option) { forEachComponent(axisName, function (axisOpt, axisIndex) { if (givenAxisIndices != null - && givenAxisIndices != 'all' + && givenAxisIndices !== 'all' && zrUtil.indexOf(givenAxisIndices, axisIndex) === -1 ) { return; diff --git a/src/component/toolbox/feature/MagicType.js b/src/component/toolbox/feature/MagicType.js index 4fd822f..a757b77 100644 --- a/src/component/toolbox/feature/MagicType.js +++ b/src/component/toolbox/feature/MagicType.js @@ -33,10 +33,12 @@ MagicType.defaultOption = { type: [], // Icon group icon: { + /* eslint-disable */ line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4', bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7', stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z', // jshint ignore:line tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z' + /* eslint-enable */ }, // `line`, `bar`, `stack`, `tiled` title: zrUtil.clone(magicTypeLang.title), @@ -147,7 +149,7 @@ proto.onclick = function (ecModel, api, type) { for (var i = 0; i <= axisIndex; i++) { newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; } - newOption[axisType][axisIndex].boundaryGap = type === 'bar' ? true : false; + newOption[axisType][axisIndex].boundaryGap = type === 'bar'; } } }; diff --git a/src/component/toolbox/feature/Restore.js b/src/component/toolbox/feature/Restore.js index 686bdc7..6ab305f 100644 --- a/src/component/toolbox/feature/Restore.js +++ b/src/component/toolbox/feature/Restore.js @@ -30,7 +30,9 @@ function Restore(model) { Restore.defaultOption = { show: true, + /* eslint-disable */ icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5', + /* eslint-enable */ title: restoreLang.title }; diff --git a/src/component/toolbox/feature/SaveAsImage.js b/src/component/toolbox/feature/SaveAsImage.js index 73ec9c1..d55c019 100644 --- a/src/component/toolbox/feature/SaveAsImage.js +++ b/src/component/toolbox/feature/SaveAsImage.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Uint8Array */ + import env from 'zrender/src/core/env'; import lang from '../../../lang'; import * as featureManager from '../featureManager'; @@ -74,7 +76,7 @@ proto.onclick = function (ecModel, api) { var bstr = atob(url.split(',')[1]); var n = bstr.length; var u8arr = new Uint8Array(n); - while(n--) { + while (n--) { u8arr[n] = bstr.charCodeAt(n); } var blob = new Blob([u8arr]); @@ -82,10 +84,10 @@ proto.onclick = function (ecModel, api) { } else { var lang = model.get('lang'); - var html = '' + - '<body style="margin:0;">' + - '<img src="' + url + '" style="max-width:100%;" title="' + ((lang && lang[0]) || '') + '" />' + - '</body>'; + var html = '' + + '<body style="margin:0;">' + + '<img src="' + url + '" style="max-width:100%;" title="' + ((lang && lang[0]) || '') + '" />' + + '</body>'; var tab = window.open(); tab.document.write(html); } diff --git a/src/component/tooltip/TooltipView.js b/src/component/tooltip/TooltipView.js index 0631e60..cd4e183 100644 --- a/src/component/tooltip/TooltipView.js +++ b/src/component/tooltip/TooltipView.js @@ -427,7 +427,7 @@ export default echarts.extendComponentView({ // (2) themeRiver, firstDataIndex is array, and first line is unnecessary. var firstLine = valueLabel; if (renderMode !== 'html') { - singleDefaultHTML.push(seriesDefaultHTML.join(newLine)) + singleDefaultHTML.push(seriesDefaultHTML.join(newLine)); } else { singleDefaultHTML.push( @@ -690,16 +690,16 @@ export default echarts.extendComponentView({ var lastIndices = lastItem.seriesDataIndices || []; var newIndices = thisItem.seriesDataIndices || []; - contentNotChanged &= - lastItem.value === thisItem.value + contentNotChanged + &= lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length; contentNotChanged && each(lastIndices, function (lastIdxItem, j) { var newIdxItem = newIndices[j]; - contentNotChanged &= - lastIdxItem.seriesIndex === newIdxItem.seriesIndex + contentNotChanged + &= lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex; }); }); diff --git a/src/component/visualMap/ContinuousModel.js b/src/component/visualMap/ContinuousModel.js index 6e4f4dd..840101c 100644 --- a/src/component/visualMap/ContinuousModel.js +++ b/src/component/visualMap/ContinuousModel.js @@ -32,19 +32,19 @@ var ContinuousModel = VisualMapModel.extend({ * @protected */ defaultOption: { - align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' - calculable: false, // This prop effect default component type determine, - // See echarts/component/visualMap/typeDefaulter. - range: null, // selected range. In default case `range` is [min, max] - // and can auto change along with modification of min max, - // util use specifid a range. - realtime: true, // Whether realtime update. - itemHeight: null, // The length of the range control edge. - itemWidth: null, // The length of the other side. - hoverLink: true, // Enable hover highlight. - hoverLinkDataSize: null,// The size of hovered data. - hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. - // If not specified, follow the value of `realtime`. + align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' + calculable: false, // This prop effect default component type determine, + // See echarts/component/visualMap/typeDefaulter. + range: null, // selected range. In default case `range` is [min, max] + // and can auto change along with modification of min max, + // util use specifid a range. + realtime: true, // Whether realtime update. + itemHeight: null, // The length of the range control edge. + itemWidth: null, // The length of the other side. + hoverLink: true, // Enable hover highlight. + hoverLinkDataSize: null, // The size of hovered data. + hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. + // If not specified, follow the value of `realtime`. }, /** diff --git a/src/component/visualMap/VisualMapModel.js b/src/component/visualMap/VisualMapModel.js index 9e73ef4..a40973e 100644 --- a/src/component/visualMap/VisualMapModel.js +++ b/src/component/visualMap/VisualMapModel.js @@ -249,7 +249,7 @@ var VisualMapModel = echarts.extendComponentModel({ * @return {string} * @protected */ - formatValueText: function(value, isCategory, edgeSymbols) { + formatValueText: function (value, isCategory, edgeSymbols) { var option = this.option; var precision = option.precision; var dataBound = this.dataBound; diff --git a/src/coord/axisDefault.js b/src/coord/axisDefault.js index 451c258..8f206c9 100644 --- a/src/coord/axisDefault.js +++ b/src/coord/axisDefault.js @@ -100,7 +100,7 @@ var defaultOption = { splitArea: { show: false, areaStyle: { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] } } }; diff --git a/src/coord/axisModelCommonMixin.js b/src/coord/axisModelCommonMixin.js index 90ab85e..8b22438 100644 --- a/src/coord/axisModelCommonMixin.js +++ b/src/coord/axisModelCommonMixin.js @@ -18,7 +18,7 @@ */ import * as zrUtil from 'zrender/src/core/util'; -import * as axisHelper from './axisHelper'; +// import * as axisHelper from './axisHelper'; export default { diff --git a/src/coord/calendar/Calendar.js b/src/coord/calendar/Calendar.js index 45f5c51..923841b 100644 --- a/src/coord/calendar/Calendar.js +++ b/src/coord/calendar/Calendar.js @@ -397,7 +397,7 @@ Calendar.prototype = { } var weeks = Math.floor((allDay + range[0].day + 6) / 7); - var nthWeek = reversed ? -weeks + 1: weeks - 1; + var nthWeek = reversed ? -weeks + 1 : weeks - 1; reversed && range.reverse(); @@ -441,9 +441,9 @@ Calendar.prototype = { } }; -Calendar.dimensions = Calendar.prototype.dimensions; +Calendar.dimensions = Calendar.prototype.dimensions; -Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; +Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; Calendar.create = function (ecModel, api) { var calendarList = []; diff --git a/src/coord/cartesian/cartesianAxisHelper.js b/src/coord/cartesian/cartesianAxisHelper.js index a60d0a1..85d4870 100644 --- a/src/coord/cartesian/cartesianAxisHelper.js +++ b/src/coord/cartesian/cartesianAxisHelper.js @@ -51,7 +51,7 @@ export function layout(gridModel, axisModel, opt) { if (otherAxisOnZeroOf) { var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); - posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); + posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); } // Axis position @@ -67,7 +67,7 @@ export function layout(gridModel, axisModel, opt) { var dirMap = {top: -1, bottom: 1, left: -1, right: 1}; layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition]; - layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0; + layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0; if (axisModel.get('axisTick.inside')) { layout.tickDirection = -layout.tickDirection; diff --git a/src/coord/geo/Region.js b/src/coord/geo/Region.js index 4de33b1..997f395 100644 --- a/src/coord/geo/Region.js +++ b/src/coord/geo/Region.js @@ -140,7 +140,7 @@ Region.prototype = { width = aspect * height; } else if (!height) { - height = width / aspect ; + height = width / aspect; } var target = new BoundingRect(x, y, width, height); var transform = rect.calculateTransform(target); diff --git a/src/coord/geo/fix/nanhai.js b/src/coord/geo/fix/nanhai.js index 4eabeaf..bdcfe18 100644 --- a/src/coord/geo/fix/nanhai.js +++ b/src/coord/geo/fix/nanhai.js @@ -25,20 +25,20 @@ import Region from '../Region'; var geoCoord = [126, 25]; var points = [ - [[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]] + [[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]] ]; for (var i = 0; i < points.length; i++) { diff --git a/src/coord/geo/fix/textCoord.js b/src/coord/geo/fix/textCoord.js index 3ec837c..fa339f6 100644 --- a/src/coord/geo/fix/textCoord.js +++ b/src/coord/geo/fix/textCoord.js @@ -18,7 +18,7 @@ */ var coordsOffsetMap = { - '南海诸岛' : [32, 80], + '南海诸岛': [32, 80], // 全国 '广东': [0, -10], '香港': [10, 5], diff --git a/src/coord/radar/RadarModel.js b/src/coord/radar/RadarModel.js index 6fad998..7463eb6 100644 --- a/src/coord/radar/RadarModel.js +++ b/src/coord/radar/RadarModel.js @@ -57,7 +57,7 @@ var RadarModel = echarts.extendComponentModel({ indicatorOpt.max = 0; } var iNameTextStyle = nameTextStyle; - if(indicatorOpt.color != null) { + if (indicatorOpt.color != null) { iNameTextStyle = zrUtil.defaults({color: indicatorOpt.color}, nameTextStyle); } // Use same configuration diff --git a/src/coord/single/Single.js b/src/coord/single/Single.js index 3dd0ffc..de11a6f 100644 --- a/src/coord/single/Single.js +++ b/src/coord/single/Single.js @@ -167,7 +167,7 @@ Single.prototype = { var isHorizontal = axis.isHorizontal(); var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; - var idx = axis.reverse ? 1 : 0; + var idx = axis.reverse ? 1 : 0; axis.setExtent(extent[idx], extent[1 - idx]); diff --git a/src/coord/single/singleCreator.js b/src/coord/single/singleCreator.js index 7cae03b..8b4547d 100644 --- a/src/coord/single/singleCreator.js +++ b/src/coord/single/singleCreator.js @@ -34,7 +34,7 @@ import CoordinateSystem from '../../CoordinateSystem'; function create(ecModel, api) { var singles = []; - ecModel.eachComponent('singleAxis', function(axisModel, idx) { + ecModel.eachComponent('singleAxis', function (axisModel, idx) { var single = new Single(axisModel, ecModel, api); single.name = 'single_' + idx; diff --git a/src/data/Graph.js b/src/data/Graph.js index a050d1f..310a2fc 100644 --- a/src/data/Graph.js +++ b/src/data/Graph.js @@ -29,7 +29,7 @@ import * as zrUtil from 'zrender/src/core/util'; import {enableClassCheck} from '../util/clazz'; // id may be function name of Object, add a prefix to avoid this problem. -function generateNodeKey (id) { +function generateNodeKey(id) { return '_EC_' + id; } /** @@ -37,7 +37,7 @@ function generateNodeKey (id) { * @constructor * @param {boolean} directed */ -var Graph = function(directed) { +var Graph = function (directed) { /** * 是否是有向图 * @type {boolean} @@ -219,7 +219,8 @@ graphProto.getEdge = function (n1, n2) { if (this._directed) { return edgesMap[n1 + '-' + n2]; - } else { + } + else { return edgesMap[n1 + '-' + n2] || edgesMap[n2 + '-' + n1]; } diff --git a/src/data/List.js b/src/data/List.js index b5672ed..132fdbf 100644 --- a/src/data/List.js +++ b/src/data/List.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float64Array, Int32Array, Uint32Array, Uint16Array */ + /** * List for data storage * @module echarts/data/List @@ -385,7 +387,7 @@ listProto.initData = function (data, nameList, dimValueGetter) { } if (__DEV__) { - if (!notProvider && (typeof data.getItem != 'function' || typeof data.count != 'function')) { + if (!notProvider && (typeof data.getItem !== 'function' || typeof data.count !== 'function')) { throw new Error('Inavlid data provider.'); } } @@ -915,14 +917,16 @@ listProto.getMedian = function (dim /*, stack */) { // Use quick select? // immutability & sort - var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) { + var sortedDimDataArray = [].concat(dimDataArray).sort(function (a, b) { return a - b; }); var len = this.count(); // calculate median - return len === 0 ? 0 : - len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : - (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; + return len === 0 + ? 0 + : len % 2 === 1 + ? sortedDimDataArray[(len - 1) / 2] + : (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; }; // /** @@ -1363,7 +1367,7 @@ listProto.selectRange = function (range) { var max2 = range[dimensions[1]][1]; for (var k = 0; k < this._chunkCount; k++) { var chunkStorage = dimStorage[k]; - var chunkStorage2= dimStorage2[k]; + var chunkStorage2 = dimStorage2[k]; var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); for (var i = 0; i < len; i++) { var val = chunkStorage[i]; diff --git a/src/data/Tree.js b/src/data/Tree.js index 4e230dd..ad81605 100644 --- a/src/data/Tree.js +++ b/src/data/Tree.js @@ -403,7 +403,7 @@ Tree.prototype = { * @param {Function} cb * @param {Object} [context] */ - eachNode: function(options, cb, context) { + eachNode: function (options, cb, context) { this.root.eachNode(options, cb, context); }, diff --git a/src/data/helper/sourceHelper.js b/src/data/helper/sourceHelper.js index dc160a5..dda5acb 100644 --- a/src/data/helper/sourceHelper.js +++ b/src/data/helper/sourceHelper.js @@ -18,7 +18,7 @@ */ import {__DEV__} from '../../config'; -import {makeInner} from '../../util/model'; +import {makeInner, getDataItemValue} from '../../util/model'; import {getCoordSysDefineBySeries} from '../../model/referHelper'; import { createHashMap, @@ -32,7 +32,6 @@ import { extend, assert } from 'zrender/src/core/util'; -import {getDataItemValue} from '../../util/model'; import Source from '../Source'; import { diff --git a/src/layout/barGrid.js b/src/layout/barGrid.js index bf83216..127a323 100644 --- a/src/layout/barGrid.js +++ b/src/layout/barGrid.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float32Array */ + import * as zrUtil from 'zrender/src/core/util'; import {parsePercent} from '../util/number'; import {isDimensionStacked} from '../data/helper/dataStackHelper'; diff --git a/src/layout/barPolar.js b/src/layout/barPolar.js index 00e4401..3cfae9f 100644 --- a/src/layout/barPolar.js +++ b/src/layout/barPolar.js @@ -37,8 +37,8 @@ function getAxisKey(axis) { */ function barLayoutPolar(seriesType, ecModel, api) { - var width = api.getWidth(); - var height = api.getHeight(); + // var width = api.getWidth(); + // var height = api.getHeight(); var lastStackCoords = {}; diff --git a/src/layout/points.js b/src/layout/points.js index d8ee940..ef85e7a 100644 --- a/src/layout/points.js +++ b/src/layout/points.js @@ -17,6 +17,8 @@ * under the License. */ +/* global Float32Array */ + import {map} from 'zrender/src/core/util'; import createRenderPlanner from '../chart/helper/createRenderPlanner'; import {isDimensionStacked} from '../data/helper/dataStackHelper'; diff --git a/src/model/Model.js b/src/model/Model.js index 03c9568..abcc2ff 100644 --- a/src/model/Model.js +++ b/src/model/Model.js @@ -160,7 +160,7 @@ Model.prototype = { }, // If path is null/undefined, return null/undefined. - parsePath: function(path) { + parsePath: function (path) { if (typeof path === 'string') { path = path.split('.'); } diff --git a/src/model/globalDefault.js b/src/model/globalDefault.js index c1e89cd..1b747cf 100644 --- a/src/model/globalDefault.js +++ b/src/model/globalDefault.js @@ -33,7 +33,10 @@ export default { // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'], // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'], // Dark colors: - color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'], + color: [ + '#c23531', '#2f4554', '#61a0a8', '#d48265', '#91c7ae', '#749f83', + '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3' + ], gradientColor: ['#f6efa6', '#d88273', '#bf444c'], diff --git a/src/scale/Time.js b/src/scale/Time.js index 8c3226a..13b21c4 100644 --- a/src/scale/Time.js +++ b/src/scale/Time.js @@ -56,7 +56,7 @@ var bisect = function (a, x, lo, hi) { lo = mid + 1; } else { - hi = mid; + hi = mid; } } return lo; diff --git a/src/stream/Scheduler.js b/src/stream/Scheduler.js index bb12abb..ce28e0e 100644 --- a/src/stream/Scheduler.js +++ b/src/stream/Scheduler.js @@ -21,7 +21,7 @@ * @module echarts/stream/Scheduler */ -import {each, map, isArray, isFunction, createHashMap, noop} from 'zrender/src/core/util'; +import {each, map, isFunction, createHashMap, noop} from 'zrender/src/core/util'; import {createTask} from './task'; import {getUID} from '../util/component'; import GlobalModel from '../model/Global'; @@ -114,7 +114,7 @@ proto.getPerformArgs = function (task, isBlock) { var step = incremental ? pipeline.step : null; var modDataCount = pCtx && pCtx.modDataCount; - var modBy = modDataCount != null ? Math.ceil(modDataCount / step): null; + var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null; return {step: step, modBy: modBy, modDataCount: modDataCount}; }; @@ -552,10 +552,12 @@ ecModelMock.eachComponent = function (cond) { }; function mockMethods(target, Clz) { + /* eslint-disable */ for (var name in Clz.prototype) { // Do not use hasOwnProperty target[name] = noop; } + /* eslint-enable */ } export default Scheduler; diff --git a/src/theme/dark.js b/src/theme/dark.js index 56cebf2..94f252e 100644 --- a/src/theme/dark.js +++ b/src/theme/dark.js @@ -49,7 +49,10 @@ var axisCommon = function () { }; }; -var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; +var colorPalette = [ + '#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', + '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42' +]; var theme = { color: colorPalette, backgroundColor: '#333', diff --git a/src/theme/light.js b/src/theme/light.js index a464f5a..0ca5935 100644 --- a/src/theme/light.js +++ b/src/theme/light.js @@ -17,7 +17,10 @@ * under the License. */ -var colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; +var colorAll = [ + '#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C', '#ff9f7f', + '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF' +]; export default { diff --git a/src/util/format.js b/src/util/format.js index 49147bb..d00cce0 100644 --- a/src/util/format.js +++ b/src/util/format.js @@ -20,7 +20,7 @@ import * as zrUtil from 'zrender/src/core/util'; import * as textContain from 'zrender/src/contain/text'; import * as numberUtil from './number'; -import Text from 'zrender/src/graphic/Text'; +// import Text from 'zrender/src/graphic/Text'; /** * 每三位默认加,格式化 @@ -32,7 +32,7 @@ export function addCommas(x) { return '-'; } x = (x + '').split('.'); - return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (x.length > 1 ? ('.' + x[1]) : ''); } @@ -42,7 +42,7 @@ export function addCommas(x) { * @return {string} str */ export function toCamelCase(str, upperCaseFirst) { - str = (str || '').toLowerCase().replace(/-(.)/g, function(match, group1) { + str = (str || '').toLowerCase().replace(/-(.)/g, function (match, group1) { return group1.toUpperCase(); }); diff --git a/src/util/graphic.js b/src/util/graphic.js index 426cb9f..f44b844 100644 --- a/src/util/graphic.js +++ b/src/util/graphic.js @@ -236,7 +236,7 @@ export function subPixelOptimize(position, lineWidth, positiveOrNegative) { } function hasFillOrStroke(fillOrStroke) { - return fillOrStroke != null && fillOrStroke != 'none'; + return fillOrStroke != null && fillOrStroke !== 'none'; } // Most lifted color are duplicated. diff --git a/src/util/number.js b/src/util/number.js index f3dad2d..e9c1000 100644 --- a/src/util/number.js +++ b/src/util/number.js @@ -280,7 +280,9 @@ export function isRadianAroundZero(val) { return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; } +/* eslint-disable */ var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line +/* eslint-enable */ /** * @param {string|Date|number} value These values can be accepted: @@ -389,18 +391,38 @@ export function nice(val, round) { var f = val / exp10; // 1 <= f < 10 var nf; if (round) { - if (f < 1.5) { nf = 1; } - else if (f < 2.5) { nf = 2; } - else if (f < 4) { nf = 3; } - else if (f < 7) { nf = 5; } - else { nf = 10; } + if (f < 1.5) { + nf = 1; + } + else if (f < 2.5) { + nf = 2; + } + else if (f < 4) { + nf = 3; + } + else if (f < 7) { + nf = 5; + } + else { + nf = 10; + } } else { - if (f < 1) { nf = 1; } - else if (f < 2) { nf = 2; } - else if (f < 3) { nf = 3; } - else if (f < 5) { nf = 5; } - else { nf = 10; } + if (f < 1) { + nf = 1; + } + else if (f < 2) { + nf = 2; + } + else if (f < 3) { + nf = 3; + } + else if (f < 5) { + nf = 5; + } + else { + nf = 10; + } } val = nf * exp10; diff --git a/src/util/quickSelect.js b/src/util/quickSelect.js index a4012e7..b4daeb6 100644 --- a/src/util/quickSelect.js +++ b/src/util/quickSelect.js @@ -85,7 +85,7 @@ function select(arr, left, right, nth, compareFunc) { export default function (arr, left, right, nth, compareFunc) { if (arguments.length <= 3) { nth = left; - if (arguments.length == 2) { + if (arguments.length === 2) { compareFunc = defaultCompareFunc; } else { diff --git a/src/visual/symbol.js b/src/visual/symbol.js index 0193fad..670a3bd 100644 --- a/src/visual/symbol.js +++ b/src/visual/symbol.js @@ -60,8 +60,8 @@ export default function (seriesType, defaultSymbolType, legendSymbol) { var itemSymbolType = itemModel.getShallow('symbol', true); var itemSymbolSize = itemModel.getShallow('symbolSize', true); - var itemSymbolKeepAspect = - itemModel.getShallow('symbolKeepAspect',true); + var itemSymbolKeepAspect + = itemModel.getShallow('symbolKeepAspect', true); // If has item symbol if (itemSymbolType != null) { diff --git a/src/visual/visualSolution.js b/src/visual/visualSolution.js index d9452be..dd07d20 100644 --- a/src/visual/visualSolution.js +++ b/src/visual/visualSolution.js @@ -28,7 +28,7 @@ var each = zrUtil.each; function hasKeys(obj) { if (obj) { - for (var name in obj){ + for (var name in obj) { if (obj.hasOwnProperty(name)) { return true; } diff --git a/theme/dark.js b/theme/dark.js index 9f786ea..e8caaf3 100644 --- a/theme/dark.js +++ b/theme/dark.js @@ -18,6 +18,7 @@ */ (function (root, factory) { + /* eslint-disable */ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['exports', 'echarts'], factory); @@ -28,6 +29,7 @@ // Browser globals factory({}, root.echarts); } + /* eslint-enable */ }(this, function (exports, echarts) { var log = function (msg) { if (typeof console !== 'undefined') { @@ -70,7 +72,10 @@ }; }; - var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; + var colorPalette = [ + '#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', + '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42' + ]; var theme = { color: colorPalette, backgroundColor: '#333', --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
