Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah authored Jan 28, 2019
2 parents ba0632b + 80f0c85 commit e550ada
Show file tree
Hide file tree
Showing 28 changed files with 9,584 additions and 6,222 deletions.
1,843 changes: 1,165 additions & 678 deletions dist/echarts-en.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts-en.common.min.js

Large diffs are not rendered by default.

4,204 changes: 2,382 additions & 1,822 deletions dist/echarts-en.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts-en.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts-en.min.js

Large diffs are not rendered by default.

1,462 changes: 939 additions & 523 deletions dist/echarts-en.simple.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts-en.simple.min.js

Large diffs are not rendered by default.

1,843 changes: 1,165 additions & 678 deletions dist/echarts.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts.common.min.js

Large diffs are not rendered by default.

4,547 changes: 2,788 additions & 1,759 deletions dist/echarts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts.min.js

Large diffs are not rendered by default.

1,462 changes: 939 additions & 523 deletions dist/echarts.simple.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/echarts.simple.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/extension/dataTool.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "echarts",
"version": "4.2.0-rc.2",
"version": "4.2.1-rc.1",
"description": "A powerful charting and visualization library for browser",
"license": "Apache-2.0",
"keywords": [
Expand All @@ -16,7 +16,7 @@
"prepublish": "node build/build.js --prepublish"
},
"dependencies": {
"zrender": "4.0.5"
"zrender": "4.0.6"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.31",
Expand Down
25 changes: 15 additions & 10 deletions src/chart/graph/GraphView.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import {onIrrelevantElement} from '../../component/helper/cursorHelper';
import * as graphic from '../../util/graphic';
import adjustEdge from './adjustEdge';

var FOCUS_ADJACENCY = '__focusNodeAdjacency';
var UNFOCUS_ADJACENCY = '__unfocusNodeAdjacency';

var nodeOpacityPath = ['itemStyle', 'opacity'];
var lineOpacityPath = ['lineStyle', 'opacity'];
Expand All @@ -47,7 +49,11 @@ function fadeOutItem(item, opacityPath, opacityRatio) {
el.downplay && el.downplay();
el.traverse(function (child) {
if (child.type !== 'group') {
child.setStyle('opacity', opacity);
var opct = child.lineLabelOriginalOpacity;
if (opct == null || opacityRatio != null) {
opct = opacity;
}
child.setStyle('opacity', opct);
}
});
}
Expand Down Expand Up @@ -151,43 +157,42 @@ export default echarts.extendChartView({
}
el.setDraggable(draggable && forceLayout);

el.off('mouseover', el.__focusNodeAdjacency);
el.off('mouseout', el.__unfocusNodeAdjacency);
el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]);
el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]);

if (itemModel.get('focusNodeAdjacency')) {
el.on('mouseover', el.__focusNodeAdjacency = function () {
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
api.dispatchAction({
type: 'focusNodeAdjacency',
seriesId: seriesModel.id,
dataIndex: el.dataIndex
});
});
el.on('mouseout', el.__unfocusNodeAdjacency = function () {
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
api.dispatchAction({
type: 'unfocusNodeAdjacency',
seriesId: seriesModel.id
});
});

}

}, this);

data.graph.eachEdge(function (edge) {
var el = edge.getGraphicEl();

el.off('mouseover', el.__focusNodeAdjacency);
el.off('mouseout', el.__unfocusNodeAdjacency);
el[FOCUS_ADJACENCY] && el.off('mouseover', el[FOCUS_ADJACENCY]);
el[UNFOCUS_ADJACENCY] && el.off('mouseout', el[UNFOCUS_ADJACENCY]);

if (edge.getModel().get('focusNodeAdjacency')) {
el.on('mouseover', el.__focusNodeAdjacency = function () {
el.on('mouseover', el[FOCUS_ADJACENCY] = function () {
api.dispatchAction({
type: 'focusNodeAdjacency',
seriesId: seriesModel.id,
edgeDataIndex: edge.dataIndex
});
});
el.on('mouseout', el.__unfocusNodeAdjacency = function () {
el.on('mouseout', el[UNFOCUS_ADJACENCY] = function () {
api.dispatchAction({
type: 'unfocusNodeAdjacency',
seriesId: seriesModel.id
Expand Down
6 changes: 5 additions & 1 deletion src/chart/helper/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ lineProto._createLine = function (lineData, idx, seriesScope) {
this.add(line);

var label = new graphic.Text({
name: 'label'
name: 'label',
// FIXME
// Temporary solution for `focusNodeAdjacency`.
// line label do not use the opacity of lineStyle.
lineLabelOriginalOpacity: 1
});
this.add(label);

Expand Down
3 changes: 2 additions & 1 deletion src/component/axis/AxisBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ var builders = {
symbol.attr({
rotation: point.rotate,
position: pos,
silent: true
silent: true,
z2: 11
});
this.group.add(symbol);
}
Expand Down
6 changes: 6 additions & 0 deletions src/data/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ listProto.appendValues = function (values, names) {

for (var i = 0; i < dimLen; i++) {
var dim = dimensions[i];
if (!rawExtent[dim]) {
rawExtent[dim] = getInitialExtent();
}
if (!storage[dim]) {
storage[dim] = [];
}
prepareChunks(storage, this._dimensionInfos[dim], chunkSize, originalChunkCount, end);
this._chunkCount = storage[dim].length;
}
Expand Down
4 changes: 2 additions & 2 deletions src/echarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ var isFunction = zrUtil.isFunction;
var isObject = zrUtil.isObject;
var parseClassType = ComponentModel.parseClassType;

export var version = '4.2.0';
export var version = '4.2.1';

export var dependencies = {
zrender: '4.0.5'
zrender: '4.0.6'
};

var TEST_FRAME_REMAIN_TIME = 1;
Expand Down
2 changes: 1 addition & 1 deletion test/axis-extrema.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<h2>cartesian category axis | xAxis: {min: undefined, max: undefined}</h2>
<div class="chart" id="main1.1"></div>

<h2>cartesian category axis | xAxis.data is empty</h2>
<h2>cartesian category axis | xAxis.data is empty (always show nothing if dataZoom)</h2>
<div class="chart" id="main1.2"></div>

<h2>cartesian category axis | xAxis: {min: -10, max: '类目3'}</h2>
Expand Down
2 changes: 1 addition & 1 deletion test/axis-interval.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1>[ Test time axis interval ]&nbsp;&nbsp;&nbsp; should not overlap when data z
};

testHelper.create(echarts, 'mainA', {
title: 'xAxis (type: time) should be 1 hour interval',
title: 'xAxis (type: time) should always be 1 hour interval',
option: option
});
});
Expand Down
114 changes: 13 additions & 101 deletions test/custom-feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
</head>
<body>
<style>
.test-title {
background: #146402;
color: #fff;
}
</style>


Expand Down Expand Up @@ -114,10 +110,10 @@
var chart = testHelper.create(echarts, 'main0', {
title: [
'Eventful: ',
'+ red circle and red rect trigger events, but green shapes not. ',
'+ Only dataIndex: 1 trigger event',
'+ events (click, mousedown, mousemove, mouseup) are printed in console log.',
'+ red circle: params.info = 0, red rect: params.info = undefined'
'Only this el trigger events: **red circle** and **red rect** of **dataIndex: 1**',
' Others not (green rect not)',
'Events (click, mousedown, mousemove, mouseup) are printed in console log.',
'red circle: params.info = 0, red rect: params.info = undefined'
],
option: option
});
Expand All @@ -129,91 +125,13 @@
});
});
});

</script>




<script>

// require([
// 'echarts'/*, 'map/js/china' */
// ], function (echarts) {

// // deprecated: this case would be wrong.

// var option = {
// xAxis: {
// min: 90,
// max: 120,
// scale: true
// },
// yAxis: {
// min: 50,
// max: 500,
// scale: true
// },
// dataZoom: [{
// type: 'inside'
// }, {
// type: 'slider'
// }],
// series: [{
// type: 'custom',
// renderItem: function (params, api) {
// var pos = api.coord([api.value(0), api.value(1)]);
// var rectClipBy = {
// x: params.coordSys.x - pos[0],
// y: params.coordSys.y - pos[1],
// width: params.coordSys.width,
// height: params.coordSys.height
// };
// var points = echarts.graphic.clipPointsByRect([
// [0, 0],
// [50, -50],
// [90, -50],
// [140, 0],
// [90, 50]
// ], rectClipBy);

// return {
// type: 'polygon',
// position: pos,
// shape: {points: points},
// style: {
// fill: 'green'
// }
// }
// },
// data: [[100, 300]]
// }]
// };

// var chart = testHelper.create(echarts, 'main1', {
// title: [
// 'Test clipPointsByRect: dataZoom clip should be normal, especially when all clipped',
// ],
// option: option
// });

// });

</script>














<script>

require([
Expand All @@ -234,9 +152,11 @@
scale: true
},
dataZoom: [{
type: 'inside'
type: 'inside',
filterMode: 'none'
}, {
type: 'slider'
type: 'slider',
filterMode: 'none'
}],
series: [{
type: 'custom',
Expand Down Expand Up @@ -270,7 +190,7 @@

var chart = testHelper.create(echarts, 'main2', {
title: [
'Test clip shape',
'The shape should be **clipped** by the grid. (TODO)',
],
option: option
});
Expand Down Expand Up @@ -422,26 +342,18 @@
x: (x0 + x1) / 2,
y: -blockHeight / 2,
text: api.value(1),
textFill: '#fff'
textFill: '#fff',
textAlign: 'center',
textVerticalAlign: 'middle'
}
// }, {
// type: 'text',
// style: {
// x: x3 - 5,
// y: -blockHeight,
// textAlign: 'right',
// textVerticalAlign: 'bottom',
// text: api.value(0),
// textFill: '#000'
// }
}]
};
}

var chart = testHelper.create(echarts, 'main3', {
title: [
'Test SVG path data auto fit to rect: ',
'the y axis label (made by custom series) should be align with axis tick',
'the y axis label (made by custom series) should be center',
],
option: option
});
Expand Down
6 changes: 6 additions & 0 deletions test/dataset-charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,16 @@
series: [{
name: 'A',
type: 'map',
label: {
show: true
},
mapType: 'china'
}, {
name: 'B',
type: 'map',
label: {
show: true
},
mapType: 'china',
datasetIndex: 1
}]
Expand Down
Loading

0 comments on commit e550ada

Please sign in to comment.