You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/01/06 20:10:07 UTC
[incubator-echarts] 01/02: fix: tweak some code style.
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch fix/some-codestyle
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 7e4b4d67f8c38978b3e5a1b9126141b59a75ed32
Author: 100pah <su...@gmail.com>
AuthorDate: Tue Jan 7 03:25:00 2020 +0800
fix: tweak some code style.
---
src/component/legend/ScrollableLegendView.js | 37 ++++++++++++++--------------
src/component/marker/markerHelper.js | 6 ++---
2 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/src/component/legend/ScrollableLegendView.js b/src/component/legend/ScrollableLegendView.js
index 668f2dc..8962f6b 100644
--- a/src/component/legend/ScrollableLegendView.js
+++ b/src/component/legend/ScrollableLegendView.js
@@ -459,29 +459,28 @@ var ScrollableLegendView = LegendView.extend({
},
_findTargetItemIndex: function (targetDataIndex) {
+ if (!this._showController) {
+ return 0;
+ }
+
var index;
var contentGroup = this.getContentGroup();
var defaultIndex;
- if (this._showController) {
- contentGroup.eachChild(function (child, idx) {
- var legendDataIdx = child.__legendDataIndex;
- // FIXME
- // If the given targetDataIndex (from model) is illegal,
- // we use defualtIndex. But the index on the legend model and
- // action payload is still illegal. That case will not be
- // changed until some scenario requires.
- if (defaultIndex == null && legendDataIdx != null) {
- defaultIndex = idx;
- }
- if (legendDataIdx === targetDataIndex) {
- index = idx;
- }
- });
- }
- else {
- return 0;
- }
+ contentGroup.eachChild(function (child, idx) {
+ var legendDataIdx = child.__legendDataIndex;
+ // FIXME
+ // If the given targetDataIndex (from model) is illegal,
+ // we use defualtIndex. But the index on the legend model and
+ // action payload is still illegal. That case will not be
+ // changed until some scenario requires.
+ if (defaultIndex == null && legendDataIdx != null) {
+ defaultIndex = idx;
+ }
+ if (legendDataIdx === targetDataIndex) {
+ index = idx;
+ }
+ });
return index != null ? index : defaultIndex;
}
diff --git a/src/component/marker/markerHelper.js b/src/component/marker/markerHelper.js
index 01f67ed..85308b0 100644
--- a/src/component/marker/markerHelper.js
+++ b/src/component/marker/markerHelper.js
@@ -78,7 +78,7 @@ function markerTypeCalculatorWithExtent(
coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
}
- return [coordArr,coordArrValue];
+ return [coordArr, coordArrValue];
}
var curry = zrUtil.curry;
@@ -146,8 +146,8 @@ export function dataTransform(seriesModel, item) {
otherCoordIndex, targetCoordIndex
);
item.coord = coordInfo[0]
- // Force to use the value of calculated value.
- // let item use the value without stack.
+ // Force to use the value of calculated value.
+ // let item use the value without stack.
item.value = coordInfo[1]
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org