echarts 3.7.1 → 3.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/echarts-en.js +77756 -0
- package/dist/echarts-en.min.js +38 -0
- package/dist/echarts.common-en.js +50169 -0
- package/dist/echarts.common-en.min.js +30 -0
- package/dist/echarts.common.js +1408 -1186
- package/dist/echarts.common.min.js +14 -14
- package/dist/echarts.js +1572 -1278
- package/dist/echarts.min.js +22 -22
- package/dist/echarts.simple-en.js +34988 -0
- package/dist/echarts.simple-en.min.js +27 -0
- package/dist/echarts.simple.js +1152 -994
- package/dist/echarts.simple.min.js +11 -11
- package/index.blank.js +4 -0
- package/lib/chart/bar/BaseBarSeries.js +3 -3
- package/lib/chart/candlestick/candlestickLayout.js +26 -1
- package/lib/chart/graph/forceHelper.js +5 -0
- package/lib/chart/graph/forceLayout.js +0 -1
- package/lib/chart/helper/whiskerBoxCommon.js +6 -1
- package/lib/chart/line/LineView.js +14 -2
- package/lib/chart/lines/LinesView.js +22 -7
- package/lib/chart/pie/PieSeries.js +3 -1
- package/lib/chart/pie/PieView.js +1 -1
- package/lib/chart/treemap/TreemapView.js +5 -28
- package/lib/component/axis/AxisBuilder.js +249 -178
- package/lib/component/axis/CartesianAxisView.js +15 -3
- package/lib/component/axis/ParallelAxisView.js +1 -1
- package/lib/component/axis/RadiusAxisView.js +1 -1
- package/lib/component/axis/SingleAxisView.js +8 -2
- package/lib/component/helper/RoamController.js +12 -11
- package/lib/component/marker/MarkAreaView.js +1 -1
- package/lib/component/radar/RadarView.js +1 -1
- package/lib/component/toolbox/feature/Brush.js +3 -8
- package/lib/component/toolbox/feature/DataView.js +3 -3
- package/lib/component/toolbox/feature/DataZoom.js +3 -4
- package/lib/component/toolbox/feature/MagicType.js +3 -6
- package/lib/component/toolbox/feature/Restore.js +2 -1
- package/lib/component/toolbox/feature/SaveAsImage.js +23 -9
- package/lib/component/visualMap/ContinuousModel.js +2 -2
- package/lib/component/visualMap/ContinuousView.js +3 -3
- package/lib/component/visualMap/PiecewiseModel.js +0 -1
- package/lib/component/visualMap/VisualMapModel.js +17 -11
- package/lib/coord/calendar/Calendar.js +64 -20
- package/lib/echarts.js +5 -4
- package/lib/lang/cn.js +4 -0
- package/lib/lang/default.js +42 -0
- package/lib/lang/en.js +42 -0
- package/lib/lang.js +42 -0
- package/lib/langEN.js +42 -0
- package/lib/preprocessor/helper/compatStyle.js +24 -23
- package/lib/scale/Time.js +4 -4
- package/lib/util/graphic.js +5 -5
- package/lib/util/number.js +42 -21
- package/lib/visual/VisualMapping.js +3 -3
- package/package.json +3 -3
- package/rollup.config.js +49 -0
- package/src/chart/bar/BaseBarSeries.js +3 -3
- package/src/chart/candlestick/candlestickLayout.js +26 -1
- package/src/chart/graph/forceHelper.js +5 -0
- package/src/chart/graph/forceLayout.js +0 -1
- package/src/chart/helper/whiskerBoxCommon.js +6 -2
- package/src/chart/line/LineView.js +14 -2
- package/src/chart/lines/LinesView.js +22 -7
- package/src/chart/pie/PieSeries.js +3 -1
- package/src/chart/pie/PieView.js +1 -1
- package/src/chart/treemap/TreemapView.js +5 -28
- package/src/component/axis/AxisBuilder.js +249 -178
- package/src/component/axis/CartesianAxisView.js +15 -3
- package/src/component/axis/ParallelAxisView.js +1 -1
- package/src/component/axis/RadiusAxisView.js +1 -1
- package/src/component/axis/SingleAxisView.js +8 -2
- package/src/component/helper/RoamController.js +12 -11
- package/src/component/marker/MarkAreaView.js +1 -1
- package/src/component/radar/RadarView.js +1 -1
- package/src/component/toolbox/feature/Brush.js +3 -8
- package/src/component/toolbox/feature/DataView.js +3 -3
- package/src/component/toolbox/feature/DataZoom.js +3 -4
- package/src/component/toolbox/feature/MagicType.js +3 -6
- package/src/component/toolbox/feature/Restore.js +2 -1
- package/src/component/toolbox/feature/SaveAsImage.js +23 -10
- package/src/component/visualMap/ContinuousModel.js +2 -2
- package/src/component/visualMap/ContinuousView.js +3 -3
- package/src/component/visualMap/PiecewiseModel.js +0 -1
- package/src/component/visualMap/VisualMapModel.js +17 -11
- package/src/coord/calendar/Calendar.js +64 -20
- package/src/echarts.js +5 -4
- package/src/lang.js +43 -0
- package/src/langEN.js +43 -0
- package/src/preprocessor/helper/compatStyle.js +24 -23
- package/src/scale/Time.js +4 -4
- package/src/util/graphic.js +5 -5
- package/src/util/number.js +42 -21
- package/src/visual/VisualMapping.js +3 -3
- package/webpack.config.js +21 -7
- package/.npmignore +0 -10
|
@@ -97,30 +97,31 @@
|
|
|
97
97
|
compatItemStyle(data[i]);
|
|
98
98
|
compatLabelTextStyle(data[i] && data[i].label);
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// mark point data
|
|
103
|
+
var markPoint = seriesOpt.markPoint;
|
|
104
|
+
if (markPoint && markPoint.data) {
|
|
105
|
+
var mpData = markPoint.data;
|
|
106
|
+
for (var i = 0; i < mpData.length; i++) {
|
|
107
|
+
compatItemStyle(mpData[i]);
|
|
108
|
+
compatLabelTextStyle(mpData[i] && mpData[i].label);
|
|
108
109
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
}
|
|
111
|
+
// mark line data
|
|
112
|
+
var markLine = seriesOpt.markLine;
|
|
113
|
+
if (markLine && markLine.data) {
|
|
114
|
+
var mlData = markLine.data;
|
|
115
|
+
for (var i = 0; i < mlData.length; i++) {
|
|
116
|
+
if (zrUtil.isArray(mlData[i])) {
|
|
117
|
+
compatItemStyle(mlData[i][0]);
|
|
118
|
+
compatLabelTextStyle(mlData[i][0] && mlData[i][0].label);
|
|
119
|
+
compatItemStyle(mlData[i][1]);
|
|
120
|
+
compatLabelTextStyle(mlData[i][1] && mlData[i][1].label);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
compatItemStyle(mlData[i]);
|
|
124
|
+
compatLabelTextStyle(mlData[i] && mlData[i].label);
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}
|
package/lib/scale/Time.js
CHANGED
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
// If there are no data and extent are [Infinity, -Infinity]
|
|
78
78
|
if (extent[1] === -Infinity && extent[0] === Infinity) {
|
|
79
79
|
var d = new Date();
|
|
80
|
-
extent[1] = new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
80
|
+
extent[1] = +new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
81
81
|
extent[0] = extent[1] - ONE_DAY;
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -98,8 +98,6 @@
|
|
|
98
98
|
* @override
|
|
99
99
|
*/
|
|
100
100
|
niceTicks: function (approxTickNum, minInterval, maxInterval) {
|
|
101
|
-
var timezoneOffset = this.getSetting('useUTC')
|
|
102
|
-
? 0 : numberUtil.getTimezoneOffset() * 60 * 1000;
|
|
103
101
|
approxTickNum = approxTickNum || 10;
|
|
104
102
|
|
|
105
103
|
var extent = this._extent;
|
|
@@ -129,9 +127,11 @@
|
|
|
129
127
|
interval *= yearStep;
|
|
130
128
|
}
|
|
131
129
|
|
|
130
|
+
var timezoneOffset = this.getSetting('useUTC')
|
|
131
|
+
? 0 : (new Date(+extent[0] || +extent[1])).getTimezoneOffset() * 60 * 1000;
|
|
132
132
|
var niceExtent = [
|
|
133
133
|
Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset),
|
|
134
|
-
Math.round(mathFloor((extent[1] - timezoneOffset)/ interval) * interval + timezoneOffset)
|
|
134
|
+
Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset)
|
|
135
135
|
];
|
|
136
136
|
|
|
137
137
|
scaleHelper.fixExtent(niceExtent, extent);
|
package/lib/util/graphic.js
CHANGED
|
@@ -550,7 +550,7 @@
|
|
|
550
550
|
* for textFill, textStroke, textBackgroundColor, and textBorderColor.
|
|
551
551
|
* If autoColor specified, it is used as default textFill.
|
|
552
552
|
* useInsideStyle:
|
|
553
|
-
* `true`: Use inside style (textFill, textStroke,
|
|
553
|
+
* `true`: Use inside style (textFill, textStroke, textStrokeWidth)
|
|
554
554
|
* if `textFill` is not specified.
|
|
555
555
|
* `false`: Do not use inside style.
|
|
556
556
|
* `null/undefined`: use inside style if `isRectText` is true and
|
|
@@ -663,7 +663,7 @@
|
|
|
663
663
|
|| globalTextStyle.color;
|
|
664
664
|
textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt)
|
|
665
665
|
|| globalTextStyle.textBorderColor;
|
|
666
|
-
textStyle.
|
|
666
|
+
textStyle.textStrokeWidth = zrUtil.retrieve2(
|
|
667
667
|
textStyleModel.getShallow('textBorderWidth'),
|
|
668
668
|
globalTextStyle.textBorderWidth
|
|
669
669
|
);
|
|
@@ -747,13 +747,13 @@
|
|
|
747
747
|
insideRollback = {
|
|
748
748
|
textFill: null,
|
|
749
749
|
textStroke: textStyle.textStroke,
|
|
750
|
-
|
|
750
|
+
textStrokeWidth: textStyle.textStrokeWidth
|
|
751
751
|
};
|
|
752
752
|
textStyle.textFill = '#fff';
|
|
753
753
|
// Consider text with #fff overflow its container.
|
|
754
754
|
if (textStyle.textStroke == null) {
|
|
755
755
|
textStyle.textStroke = opt.autoColor;
|
|
756
|
-
textStyle.
|
|
756
|
+
textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
759
|
|
|
@@ -765,7 +765,7 @@
|
|
|
765
765
|
if (insideRollback) {
|
|
766
766
|
style.textFill = insideRollback.textFill;
|
|
767
767
|
style.textStroke = insideRollback.textStroke;
|
|
768
|
-
style.
|
|
768
|
+
style.textStrokeWidth = insideRollback.textStrokeWidth;
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
|
package/lib/util/number.js
CHANGED
|
@@ -273,11 +273,14 @@
|
|
|
273
273
|
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
|
|
274
274
|
|
|
275
275
|
/**
|
|
276
|
+
* Consider DST, it is incorrect to provide a method `getTimezoneOffset`
|
|
277
|
+
* without time specified. So this method is removed.
|
|
278
|
+
*
|
|
276
279
|
* @return {number} in minutes
|
|
277
280
|
*/
|
|
278
|
-
number.getTimezoneOffset = function () {
|
|
279
|
-
|
|
280
|
-
};
|
|
281
|
+
// number.getTimezoneOffset = function () {
|
|
282
|
+
// return (new Date()).getTimezoneOffset();
|
|
283
|
+
// };
|
|
281
284
|
|
|
282
285
|
/**
|
|
283
286
|
* @param {string|Date|number} value These values can be accepted:
|
|
@@ -311,24 +314,42 @@
|
|
|
311
314
|
return new Date(NaN);
|
|
312
315
|
}
|
|
313
316
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
317
|
+
// Use local time when no timezone offset specifed.
|
|
318
|
+
if (!match[8]) {
|
|
319
|
+
// match[n] can only be string or undefined.
|
|
320
|
+
// But take care of '12' + 1 => '121'.
|
|
321
|
+
return new Date(
|
|
322
|
+
+match[1],
|
|
323
|
+
+(match[2] || 1) - 1,
|
|
324
|
+
+match[3] || 1,
|
|
325
|
+
+match[4] || 0,
|
|
326
|
+
+(match[5] || 0),
|
|
327
|
+
+match[6] || 0,
|
|
328
|
+
+match[7] || 0
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
// Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,
|
|
332
|
+
// https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).
|
|
333
|
+
// For example, system timezone is set as "Time Zone: America/Toronto",
|
|
334
|
+
// then these code will get different result:
|
|
335
|
+
// `new Date(1478411999999).getTimezoneOffset(); // get 240`
|
|
336
|
+
// `new Date(1478412000000).getTimezoneOffset(); // get 300`
|
|
337
|
+
// So we should not use `new Date`, but use `Date.UTC`.
|
|
338
|
+
else {
|
|
339
|
+
var hour = +match[4] || 0;
|
|
340
|
+
if (match[8].toUpperCase() !== 'Z') {
|
|
341
|
+
hour -= match[8].slice(0, 3);
|
|
342
|
+
}
|
|
343
|
+
return new Date(Date.UTC(
|
|
344
|
+
+match[1],
|
|
345
|
+
+(match[2] || 1) - 1,
|
|
346
|
+
+match[3] || 1,
|
|
347
|
+
hour,
|
|
348
|
+
+(match[5] || 0),
|
|
349
|
+
+match[6] || 0,
|
|
350
|
+
+match[7] || 0
|
|
351
|
+
));
|
|
352
|
+
}
|
|
332
353
|
}
|
|
333
354
|
else if (value == null) {
|
|
334
355
|
return new Date(NaN);
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
// which will be much faster and useful in pixel manipulation
|
|
143
143
|
var returnRGBArray = !!out;
|
|
144
144
|
!isNormalized && (value = this._normalizeData(value));
|
|
145
|
-
out = zrColor.
|
|
145
|
+
out = zrColor.fastLerp(value, thisOption.parsedVisual, out);
|
|
146
146
|
return returnRGBArray ? out : zrColor.stringify(out, 'rgba');
|
|
147
147
|
},
|
|
148
148
|
this
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
_doMap: {
|
|
153
153
|
linear: function (normalized) {
|
|
154
154
|
return zrColor.stringify(
|
|
155
|
-
zrColor.
|
|
155
|
+
zrColor.fastLerp(normalized, this.option.parsedVisual),
|
|
156
156
|
'rgba'
|
|
157
157
|
);
|
|
158
158
|
},
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
var result = getSpecifiedVisual.call(this, value);
|
|
162
162
|
if (result == null) {
|
|
163
163
|
result = zrColor.stringify(
|
|
164
|
-
zrColor.
|
|
164
|
+
zrColor.fastLerp(normalized, this.option.parsedVisual),
|
|
165
165
|
'rgba'
|
|
166
166
|
);
|
|
167
167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echarts",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"description": "A powerful charting and visualization library for browser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visualization",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prepublish": "node build/amd2common.js"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"zrender": "^3.6.
|
|
38
|
+
"zrender": "^3.6.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"coordtransform": "^2.0.2",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"fs-extra": "^0.26.5",
|
|
46
46
|
"glob": "^7.0.0",
|
|
47
47
|
"webpack": "^1.12.13",
|
|
48
|
-
"zrender": "^3.6.
|
|
48
|
+
"zrender": "^3.6.2"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import resolve from 'rollup-plugin-node-resolve';
|
|
2
|
+
import commonjs from 'rollup-plugin-commonjs';
|
|
3
|
+
import uglify from 'rollup-plugin-uglify';
|
|
4
|
+
|
|
5
|
+
function plugins(production) {
|
|
6
|
+
let plugins = [
|
|
7
|
+
resolve(),
|
|
8
|
+
commonjs()
|
|
9
|
+
];
|
|
10
|
+
if (production) {
|
|
11
|
+
plugins.push(uglify({
|
|
12
|
+
compress: {
|
|
13
|
+
global_defs: {
|
|
14
|
+
__DEV__: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
return plugins;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function createBuild(type, production) {
|
|
23
|
+
if (type) {
|
|
24
|
+
type = '.' + type;
|
|
25
|
+
}
|
|
26
|
+
var postfix = '';
|
|
27
|
+
if (production) {
|
|
28
|
+
postfix = '.min';
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
entry: `./index${type}.js`,
|
|
32
|
+
format: 'umd',
|
|
33
|
+
moduleName: 'echarts',
|
|
34
|
+
plugins: plugins(production),
|
|
35
|
+
dest: `dist/echarts${type}${postfix}.js`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default [
|
|
40
|
+
createBuild('blank', false),
|
|
41
|
+
createBuild('simple', false),
|
|
42
|
+
createBuild('common', false),
|
|
43
|
+
createBuild('', false),
|
|
44
|
+
|
|
45
|
+
createBuild('blank', true),
|
|
46
|
+
createBuild('simple', true),
|
|
47
|
+
createBuild('common', true),
|
|
48
|
+
createBuild('', true)
|
|
49
|
+
];
|
|
@@ -34,6 +34,8 @@ define(function (require) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
var dataIndex = 0;
|
|
38
|
+
|
|
37
39
|
data.each([cDim].concat(vDims), function () {
|
|
38
40
|
var args = arguments;
|
|
39
41
|
var axisDimVal = args[0];
|
|
@@ -67,9 +69,30 @@ define(function (require) {
|
|
|
67
69
|
addBodyEnd(ocHighPoint, 0);
|
|
68
70
|
addBodyEnd(ocLowPoint, 1);
|
|
69
71
|
|
|
72
|
+
var sign;
|
|
73
|
+
if (openVal > closeVal) {
|
|
74
|
+
sign = -1;
|
|
75
|
+
}
|
|
76
|
+
else if (openVal < closeVal) {
|
|
77
|
+
sign = 1;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// If close === open, compare with close of last record
|
|
81
|
+
if (dataIndex > 0) {
|
|
82
|
+
sign = data.getItemModel(dataIndex - 1).get()[2]
|
|
83
|
+
<= closeVal
|
|
84
|
+
? 1
|
|
85
|
+
: -1;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// No record of previous, set to be positive
|
|
89
|
+
sign = 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
data.setItemLayout(idx, {
|
|
71
94
|
chartLayout: chartLayout,
|
|
72
|
-
sign:
|
|
95
|
+
sign: sign,
|
|
73
96
|
initBaseline: openVal > closeVal
|
|
74
97
|
? ocHighPoint[constDim] : ocLowPoint[constDim], // open point.
|
|
75
98
|
bodyEnds: bodyEnds,
|
|
@@ -77,6 +100,8 @@ define(function (require) {
|
|
|
77
100
|
brushRect: makeBrushRect()
|
|
78
101
|
});
|
|
79
102
|
|
|
103
|
+
++dataIndex;
|
|
104
|
+
|
|
80
105
|
function getPoint(val) {
|
|
81
106
|
var p = [];
|
|
82
107
|
p[variableDim] = axisDimVal;
|
|
@@ -83,6 +83,11 @@ define(function (require) {
|
|
|
83
83
|
vec2.sub(v12, n2.p, n1.p);
|
|
84
84
|
var d = vec2.len(v12) - e.d;
|
|
85
85
|
var w = n2.w / (n1.w + n2.w);
|
|
86
|
+
|
|
87
|
+
if (isNaN(w)) {
|
|
88
|
+
w = 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
86
91
|
vec2.normalize(v12, v12);
|
|
87
92
|
|
|
88
93
|
!n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);
|
|
@@ -49,7 +49,6 @@ define(function (require) {
|
|
|
49
49
|
|
|
50
50
|
var nodes = nodeData.mapArray('value', function (value, idx) {
|
|
51
51
|
var point = nodeData.getItemLayout(idx);
|
|
52
|
-
// var w = numberUtil.linearMap(value, nodeDataExtent, [0, 50]);
|
|
53
52
|
var rep = numberUtil.linearMap(value, nodeDataExtent, repulsion);
|
|
54
53
|
if (isNaN(rep)) {
|
|
55
54
|
rep = (repulsion[0] + repulsion[1]) / 2;
|
|
@@ -55,7 +55,11 @@ define(function(require) {
|
|
|
55
55
|
var data = option.data;
|
|
56
56
|
|
|
57
57
|
addOrdinal && zrUtil.each(data, function (item, index) {
|
|
58
|
-
|
|
58
|
+
if (item.value && zrUtil.isArray(item.value)) {
|
|
59
|
+
item.value.unshift(index);
|
|
60
|
+
} else {
|
|
61
|
+
zrUtil.isArray(item) && item.unshift(index);
|
|
62
|
+
}
|
|
59
63
|
});
|
|
60
64
|
|
|
61
65
|
var defaultValueDimensions = this.defaultValueDimensions;
|
|
@@ -121,4 +125,4 @@ define(function(require) {
|
|
|
121
125
|
seriesModelMixin: seriesModelMixin,
|
|
122
126
|
viewMixin: viewMixin
|
|
123
127
|
};
|
|
124
|
-
});
|
|
128
|
+
});
|
|
@@ -54,8 +54,20 @@ define(function(require) {
|
|
|
54
54
|
function getStackedOnPoints(coordSys, data) {
|
|
55
55
|
var baseAxis = coordSys.getBaseAxis();
|
|
56
56
|
var valueAxis = coordSys.getOtherAxis(baseAxis);
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
|
|
58
|
+
var valueStart = 0;
|
|
59
|
+
if (!baseAxis.onZero) {
|
|
60
|
+
var extent = valueAxis.scale.getExtent();
|
|
61
|
+
if (extent[0] > 0) {
|
|
62
|
+
// Both positive
|
|
63
|
+
valueStart = extent[0];
|
|
64
|
+
}
|
|
65
|
+
else if (extent[1] < 0) {
|
|
66
|
+
// Both negative
|
|
67
|
+
valueStart = extent[1];
|
|
68
|
+
}
|
|
69
|
+
// If is one positive, and one negative, onZero shall be true
|
|
70
|
+
}
|
|
59
71
|
|
|
60
72
|
var valueDim = valueAxis.dim;
|
|
61
73
|
|
|
@@ -48,9 +48,13 @@ define(function (require) {
|
|
|
48
48
|
var zr = api.getZr();
|
|
49
49
|
// Avoid the drag cause ghost shadow
|
|
50
50
|
// FIXME Better way ?
|
|
51
|
-
|
|
51
|
+
// SVG doesn't support
|
|
52
|
+
var isSvg = zr.painter.getType() === 'svg';
|
|
53
|
+
if (!isSvg) {
|
|
54
|
+
zr.painter.getLayer(zlevel).clear(true);
|
|
55
|
+
}
|
|
52
56
|
// Config layer with motion blur
|
|
53
|
-
if (this._lastZlevel != null) {
|
|
57
|
+
if (this._lastZlevel != null && !isSvg) {
|
|
54
58
|
zr.configLayer(this._lastZlevel, {
|
|
55
59
|
motionBlur: false
|
|
56
60
|
});
|
|
@@ -66,10 +70,12 @@ define(function (require) {
|
|
|
66
70
|
notInIndividual && console.warn('Lines with trail effect should have an individual zlevel');
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
if (!isSvg) {
|
|
74
|
+
zr.configLayer(zlevel, {
|
|
75
|
+
motionBlur: true,
|
|
76
|
+
lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
this.group.add(lineDraw.group);
|
|
@@ -83,11 +89,20 @@ define(function (require) {
|
|
|
83
89
|
this._lineDraw.updateLayout(seriesModel);
|
|
84
90
|
// Not use motion when dragging or zooming
|
|
85
91
|
var zr = api.getZr();
|
|
86
|
-
zr.painter.
|
|
92
|
+
var isSvg = zr.painter.getType() === 'svg';
|
|
93
|
+
if (!isSvg) {
|
|
94
|
+
zr.painter.getLayer(this._lastZlevel).clear(true);
|
|
95
|
+
}
|
|
87
96
|
},
|
|
88
97
|
|
|
89
98
|
remove: function (ecModel, api) {
|
|
90
99
|
this._lineDraw && this._lineDraw.remove(api, true);
|
|
100
|
+
// Clear motion when lineDraw is removed
|
|
101
|
+
var zr = api.getZr();
|
|
102
|
+
var isSvg = zr.painter.getType() === 'svg';
|
|
103
|
+
if (!isSvg) {
|
|
104
|
+
zr.painter.getLayer(this._lastZlevel).clear(true);
|
|
105
|
+
}
|
|
91
106
|
},
|
|
92
107
|
|
|
93
108
|
dispose: function () {}
|
package/src/chart/pie/PieView.js
CHANGED
|
@@ -67,12 +67,6 @@
|
|
|
67
67
|
* @private
|
|
68
68
|
*/
|
|
69
69
|
this._state = 'ready';
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* @private
|
|
73
|
-
* @type {boolean}
|
|
74
|
-
*/
|
|
75
|
-
this._mayClick;
|
|
76
70
|
},
|
|
77
71
|
|
|
78
72
|
/**
|
|
@@ -397,8 +391,6 @@
|
|
|
397
391
|
* @private
|
|
398
392
|
*/
|
|
399
393
|
_onPan: function (dx, dy) {
|
|
400
|
-
this._mayClick = false;
|
|
401
|
-
|
|
402
394
|
if (this._state !== 'animating'
|
|
403
395
|
&& (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD)
|
|
404
396
|
) {
|
|
@@ -431,8 +423,6 @@
|
|
|
431
423
|
* @private
|
|
432
424
|
*/
|
|
433
425
|
_onZoom: function (scale, mouseX, mouseY) {
|
|
434
|
-
this._mayClick = false;
|
|
435
|
-
|
|
436
426
|
if (this._state !== 'animating') {
|
|
437
427
|
// These param must not be cached.
|
|
438
428
|
var root = this.seriesModel.getData().tree.root;
|
|
@@ -480,25 +470,11 @@
|
|
|
480
470
|
* @private
|
|
481
471
|
*/
|
|
482
472
|
_initEvents: function (containerGroup) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
// 还是会触发click,期望是不触发。
|
|
487
|
-
|
|
488
|
-
// Mousedown occurs when drag start, and mouseup occurs when drag end,
|
|
489
|
-
// click event should not be triggered in that case.
|
|
490
|
-
|
|
491
|
-
containerGroup.on('mousedown', function (e) {
|
|
492
|
-
this._state === 'ready' && (this._mayClick = true);
|
|
493
|
-
}, this);
|
|
494
|
-
containerGroup.on('mouseup', function (e) {
|
|
495
|
-
if (this._mayClick) {
|
|
496
|
-
this._mayClick = false;
|
|
497
|
-
this._state === 'ready' && onClick.call(this, e);
|
|
473
|
+
containerGroup.on('click', function (e) {
|
|
474
|
+
if (this._state !== 'ready') {
|
|
475
|
+
return;
|
|
498
476
|
}
|
|
499
|
-
}, this);
|
|
500
477
|
|
|
501
|
-
function onClick(e) {
|
|
502
478
|
var nodeClick = this.seriesModel.get('nodeClick', true);
|
|
503
479
|
|
|
504
480
|
if (!nodeClick) {
|
|
@@ -526,7 +502,8 @@
|
|
|
526
502
|
link && window.open(link, linkTarget);
|
|
527
503
|
}
|
|
528
504
|
}
|
|
529
|
-
|
|
505
|
+
|
|
506
|
+
}, this);
|
|
530
507
|
},
|
|
531
508
|
|
|
532
509
|
/**
|