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
package/index.blank.js
ADDED
|
@@ -34,6 +34,8 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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;
|
|
@@ -49,7 +49,6 @@
|
|
|
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;
|
|
@@ -54,7 +54,11 @@
|
|
|
54
54
|
var data = option.data;
|
|
55
55
|
|
|
56
56
|
addOrdinal && zrUtil.each(data, function (item, index) {
|
|
57
|
-
|
|
57
|
+
if (item.value && zrUtil.isArray(item.value)) {
|
|
58
|
+
item.value.unshift(index);
|
|
59
|
+
} else {
|
|
60
|
+
zrUtil.isArray(item) && item.unshift(index);
|
|
61
|
+
}
|
|
58
62
|
});
|
|
59
63
|
|
|
60
64
|
var defaultValueDimensions = this.defaultValueDimensions;
|
|
@@ -120,3 +124,4 @@
|
|
|
120
124
|
seriesModelMixin: seriesModelMixin,
|
|
121
125
|
viewMixin: viewMixin
|
|
122
126
|
};
|
|
127
|
+
|
|
@@ -53,8 +53,20 @@
|
|
|
53
53
|
function getStackedOnPoints(coordSys, data) {
|
|
54
54
|
var baseAxis = coordSys.getBaseAxis();
|
|
55
55
|
var valueAxis = coordSys.getOtherAxis(baseAxis);
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
|
|
57
|
+
var valueStart = 0;
|
|
58
|
+
if (!baseAxis.onZero) {
|
|
59
|
+
var extent = valueAxis.scale.getExtent();
|
|
60
|
+
if (extent[0] > 0) {
|
|
61
|
+
// Both positive
|
|
62
|
+
valueStart = extent[0];
|
|
63
|
+
}
|
|
64
|
+
else if (extent[1] < 0) {
|
|
65
|
+
// Both negative
|
|
66
|
+
valueStart = extent[1];
|
|
67
|
+
}
|
|
68
|
+
// If is one positive, and one negative, onZero shall be true
|
|
69
|
+
}
|
|
58
70
|
|
|
59
71
|
var valueDim = valueAxis.dim;
|
|
60
72
|
|
|
@@ -48,9 +48,13 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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/lib/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
|
/**
|