Skip to content

Commit d4f37c4

Browse files
authored
Merge pull request apache#12317 from apache/release
Release of 4.7.0 -> master
2 parents 3754a24 + 4f3748d commit d4f37c4

28 files changed

+4693
-1890
lines changed

dist/echarts-en.common.js

Lines changed: 684 additions & 300 deletions
Large diffs are not rendered by default.

dist/echarts-en.common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.js

Lines changed: 1070 additions & 407 deletions
Large diffs are not rendered by default.

dist/echarts-en.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts-en.simple.js

Lines changed: 499 additions & 222 deletions
Large diffs are not rendered by default.

dist/echarts-en.simple.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts.common.js

Lines changed: 684 additions & 300 deletions
Large diffs are not rendered by default.

dist/echarts.common.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts.js

Lines changed: 1070 additions & 407 deletions
Large diffs are not rendered by default.

dist/echarts.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/echarts.simple.js

Lines changed: 499 additions & 222 deletions
Large diffs are not rendered by default.

dist/echarts.simple.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

map/js/china.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

map/json/china.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "echarts",
3-
"version": "4.6.0",
3+
"version": "4.7.0",
44
"description": "A powerful charting and visualization library for browser",
55
"license": "Apache-2.0",
66
"keywords": [
@@ -27,7 +27,7 @@
2727
"lint:dist": "echo 'It might take a while. Please wait ...' && ./node_modules/.bin/jshint --config .jshintrc-dist dist/echarts.js"
2828
},
2929
"dependencies": {
30-
"zrender": "4.2.0"
30+
"zrender": "4.3.0"
3131
},
3232
"devDependencies": {
3333
"@babel/core": "7.3.4",

src/chart/bar/BarView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export default echarts.extendChartView({
145145
bgEls[dataIndex] = bgEl;
146146
}
147147

148+
// If dataZoom in filteMode: 'empty', the baseValue can be set as NaN in "axisProxy".
148149
if (!data.hasValue(dataIndex)) {
149150
return;
150151
}

src/chart/graph/GraphSeries.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ var GraphSeries = echarts.extendSeriesModel({
242242
edgeSymbol: ['none', 'none'],
243243
edgeSymbolSize: 10,
244244
edgeLabel: {
245-
position: 'middle'
245+
position: 'middle',
246+
distance: 5
246247
},
247248

248249
draggable: false,

src/chart/treemap/TreemapView.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,10 @@ function renderNode(
779779
// If invisible, do not set visual, otherwise the element will
780780
// change immediately before animation. We think it is OK to
781781
// remain its origin color when moving out of the view window.
782-
processInvisible(content);
782+
processInvisible(bg);
783783
}
784784
else {
785+
bg.invisible = false;
785786
var visualBorderColor = thisNode.getVisual('borderColor', true);
786787
var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor');
787788
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
@@ -832,6 +833,7 @@ function renderNode(
832833
processInvisible(content);
833834
}
834835
else {
836+
content.invisible = false;
835837
var visualColor = thisNode.getVisual('color', true);
836838
var normalStyle = getItemStyleNormal(itemStyleNormalModel);
837839
normalStyle.fill = visualColor;

src/coord/radar/Radar.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Radar.prototype.update = function (ecModel, api) {
195195
var fixedMax = axisModel.getMax();
196196
var interval = scale.getInterval();
197197

198+
198199
if (fixedMin != null && fixedMax != null) {
199200
// User set min, max, divide to get new interval
200201
scale.setExtent(+fixedMin, +fixedMax);
@@ -230,13 +231,10 @@ Radar.prototype.update = function (ecModel, api) {
230231
if (nicedSplitNumber > splitNumber) {
231232
interval = increaseInterval(interval);
232233
}
233-
// PENDING
234-
var center = Math.ceil((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval;
235-
var halfSplitNumber = Math.round(splitNumber / 2);
236-
scale.setExtent(
237-
numberUtil.round(center - halfSplitNumber * interval),
238-
numberUtil.round(center + (splitNumber - halfSplitNumber) * interval)
239-
);
234+
// TODO
235+
var max = Math.ceil(rawExtent[1] / interval) * interval;
236+
var min = numberUtil.round(max - interval * splitNumber);
237+
scale.setExtent(min, max);
240238
scale.setInterval(interval);
241239
}
242240
});

src/echarts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ var isFunction = zrUtil.isFunction;
5151
var isObject = zrUtil.isObject;
5252
var parseClassType = ComponentModel.parseClassType;
5353

54-
export var version = '4.6.0';
54+
export var version = '4.7.0';
5555

5656
export var dependencies = {
57-
zrender: '4.2.0'
57+
zrender: '4.3.0'
5858
};
5959

6060
var TEST_FRAME_REMAIN_TIME = 1;

src/layout/barGrid.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,10 @@ export function layout(seriesType, ecModel) {
452452
if (Math.abs(width) < barMinHeight) {
453453
width = (width < 0 ? -1 : 1) * barMinHeight;
454454
}
455-
stacked && (lastStackCoords[stackId][baseValue][sign] += width);
455+
// Ignore stack from NaN value
456+
if (!isNaN(width)) {
457+
stacked && (lastStackCoords[stackId][baseValue][sign] += width);
458+
}
456459
}
457460
else {
458461
var coord = cartesian.dataToPoint([baseValue, value]);
@@ -465,7 +468,10 @@ export function layout(seriesType, ecModel) {
465468
// Include zero to has a positive bar
466469
height = (height <= 0 ? -1 : 1) * barMinHeight;
467470
}
468-
stacked && (lastStackCoords[stackId][baseValue][sign] += height);
471+
// Ignore stack from NaN value
472+
if (!isNaN(height)) {
473+
stacked && (lastStackCoords[stackId][baseValue][sign] += height);
474+
}
469475
}
470476

471477
data.setItemLayout(idx, {

test/bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
for (var i = 0; i < 10; i++) {
8484
xAxisData.push('类目' + i);
85-
data1.push((Math.random() * 5).toFixed(2));
85+
data1.push(i === 0 ? '-' : (Math.random() * 5).toFixed(2));
8686
data2.push(-Math.random().toFixed(2));
8787
data3.push((Math.random() + 0.5).toFixed(2));
8888
data4.push((Math.random() + 0.3).toFixed(2));

test/radar-axis.html

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<!DOCTYPE html>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
21+
22+
<html>
23+
<head>
24+
<meta charset="utf-8">
25+
<meta name="viewport" content="width=device-width, initial-scale=1" />
26+
<script src="lib/esl.js"></script>
27+
<script src="lib/config.js"></script>
28+
<script src="lib/jquery.min.js"></script>
29+
<script src="lib/facePrint.js"></script>
30+
<script src="lib/testHelper.js"></script>
31+
<!-- <script src="ut/lib/canteen.js"></script> -->
32+
<link rel="stylesheet" href="lib/reset.css" />
33+
</head>
34+
<body>
35+
<style>
36+
</style>
37+
38+
39+
40+
<div id="main0"></div>
41+
42+
43+
<script>
44+
require(['echarts'], function (echarts) {
45+
var option;
46+
47+
option = {
48+
title: {
49+
text: '基础雷达图'
50+
},
51+
tooltip: {},
52+
legend: {
53+
data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
54+
},
55+
radar: {
56+
// shape: 'circle',
57+
name: {
58+
textStyle: {
59+
color: '#fff',
60+
backgroundColor: '#999',
61+
borderRadius: 3,
62+
padding: [3, 5]
63+
}
64+
},
65+
indicator: [
66+
{ name: '销售(sales)'},
67+
{ name: '管理(Administration)'},
68+
{ name: '信息技术(Information Techology)'},
69+
{ name: '客服(Customer Support)'},
70+
{ name: '研发(Development)'},
71+
{ name: '市场(Marketing)'}
72+
],
73+
axisLabel: {
74+
show: true,
75+
textStyle: {
76+
color: 'red'
77+
}
78+
},
79+
},
80+
series: [{
81+
name: '预算 vs 开销(Budget vs spending)',
82+
type: 'radar',
83+
// areaStyle: {normal: {}},
84+
data : [
85+
{
86+
value : [4300, 10000, 28000, 35000, 50000, 19000],
87+
name : '预算分配(Allocated Budget)'
88+
},
89+
{
90+
value : [5000, 14000, 28000, 31000, 42000, 21000],
91+
name : '实际开销(Actual Spending)'
92+
}
93+
]
94+
}]
95+
};
96+
97+
var chart = testHelper.create(echarts, 'main0', {
98+
title: [
99+
'Should not exceed axis',
100+
'From case https://github.com/apache/incubator-echarts/pull/11841'
101+
],
102+
option: option
103+
// height: 300,
104+
// buttons: [{text: 'btn-txt', onclick: function () {}}],
105+
// recordCanvas: true,
106+
});
107+
});
108+
</script>
109+
110+
111+
</body>
112+
</html>
113+

test/runTest/Timeline.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ module.exports = class Timeline {
3131
this._currentOpIndex = 0;
3232

3333
this._client;
34+
35+
this._isLastOpMousewheel = false;
3436
}
3537

3638
_reset() {
3739
this._currentOpIndex = 0;
3840
this._current = Date.now();
3941
this._elapsedTime = 0;
42+
this._isLastOpMousewheel = false;
4043
}
4144

4245

@@ -102,6 +105,7 @@ module.exports = class Timeline {
102105
}
103106

104107
let page = this._page;
108+
let takenScreenshot = false;
105109
switch (op.type) {
106110
case 'mousedown':
107111
await page.mouse.move(op.x, op.y);
@@ -130,7 +134,7 @@ module.exports = class Timeline {
130134

131135
element.dispatchEvent(event);
132136
}, op.x, op.y, op.deltaX || 0, op.deltaY);
133-
137+
this._isLastOpMousewheel = true;
134138
// console.log('mousewheel', op.x, op.y, op.deltaX, op.deltaY);
135139
// await this._client.send('Input.dispatchMouseEvent', {
136140
// type: 'mouseWheel',
@@ -139,9 +143,10 @@ module.exports = class Timeline {
139143
// deltaX: op.deltaX,
140144
// deltaY: op.deltaY
141145
// });
142-
// break;
146+
break;
143147
case 'screenshot':
144148
await takeScreenshot();
149+
takenScreenshot = true;
145150
break;
146151
case 'valuechange':
147152
if (op.target === 'select') {
@@ -159,7 +164,16 @@ module.exports = class Timeline {
159164
// TODO Configuration time
160165
await waitTime(delay / playbackSpeed);
161166
await takeScreenshot();
167+
takenScreenshot = true;
162168
this._currentOpIndex++;
163169
}
170+
171+
if (this._isLastOpMousewheel && op.type !== 'mousewheel') {
172+
// Only take screenshot after mousewheel finished
173+
if (!takenScreenshot) {
174+
takeScreenshot();
175+
}
176+
this._isLastOpMousewheel = false;
177+
}
164178
}
165179
};

test/ut/core/extendExpect.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11

2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
21+
222
const utHelper = require('./utHelper');
323

424
// Setup expectes

0 commit comments

Comments
 (0)