From 1b9a420aa2637ede8ff67f49313b6ca19d6aa076 Mon Sep 17 00:00:00 2001 From: sushuang Date: Mon, 14 Jan 2019 02:35:26 +0800 Subject: [PATCH 1/7] Update version --- package.json | 6 +++--- src/echarts.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b3951f0c57..99c929a1dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "echarts", - "version": "4.2.0-rc.2", + "version": "4.2.0-rc.3", "description": "A powerful charting and visualization library for browser", "license": "Apache-2.0", "keywords": [ @@ -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", @@ -35,6 +35,6 @@ "rollup": "0.50.0", "rollup-plugin-node-resolve": "3.0.0", "rollup-plugin-uglify": "2.0.1", - "zrender": "4.0.5" + "zrender": "4.0.6" } } diff --git a/src/echarts.js b/src/echarts.js index a44c2bcc7d..1c4953e125 100644 --- a/src/echarts.js +++ b/src/echarts.js @@ -54,7 +54,7 @@ var parseClassType = ComponentModel.parseClassType; export var version = '4.2.0'; export var dependencies = { - zrender: '4.0.5' + zrender: '4.0.6' }; var TEST_FRAME_REMAIN_TIME = 1; From ef9133c4f23e3cd3d9bbd48486eb1a0b962d6c8a Mon Sep 17 00:00:00 2001 From: sushuang Date: Fri, 18 Jan 2019 17:21:42 +0800 Subject: [PATCH 2/7] fix(graph): fix hover style disabled by focusNodeAdjacency --- src/chart/graph/GraphView.js | 19 +-- test/graph-simple.html | 240 ++++++++++++++++++++--------------- test/tmp-base.html | 4 +- 3 files changed, 152 insertions(+), 111 deletions(-) diff --git a/src/chart/graph/GraphView.js b/src/chart/graph/GraphView.js index 01d6f745f5..27f0bd1574 100644 --- a/src/chart/graph/GraphView.js +++ b/src/chart/graph/GraphView.js @@ -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']; @@ -151,24 +153,23 @@ 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); @@ -176,18 +177,18 @@ export default echarts.extendChartView({ 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 diff --git a/test/graph-simple.html b/test/graph-simple.html index 0fcbe9e7e9..8478a3f9ba 100644 --- a/test/graph-simple.html +++ b/test/graph-simple.html @@ -24,132 +24,170 @@ + + - - hover node3, edge label should be displayed. - 节点1 should display value in tooltip. -
+ +
+
+ + \ No newline at end of file diff --git a/test/tmp-base.html b/test/tmp-base.html index fb3a3ba75e..90ad917852 100644 --- a/test/tmp-base.html +++ b/test/tmp-base.html @@ -28,6 +28,7 @@ + @@ -54,7 +55,8 @@ // }); var chart = testHelper.create(echarts, 'main0', { - option: option + option: option, + // recordCanvas: true }); }); From 3256d17a5bdaad4a7e0c5aa5e63a7ed1eb01bb8b Mon Sep 17 00:00:00 2001 From: sushuang Date: Fri, 18 Jan 2019 22:38:01 +0800 Subject: [PATCH 3/7] fix(graph): Fix that line label can not return to its original opacity after "focusNodeAdjacency". --- src/chart/graph/GraphView.js | 6 +++++- src/chart/helper/Line.js | 6 +++++- test/graph-simple.html | 18 ++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/chart/graph/GraphView.js b/src/chart/graph/GraphView.js index 27f0bd1574..32e1ebc7f3 100644 --- a/src/chart/graph/GraphView.js +++ b/src/chart/graph/GraphView.js @@ -49,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); } }); } diff --git a/src/chart/helper/Line.js b/src/chart/helper/Line.js index b9b80864e9..2b81a7a432 100644 --- a/src/chart/helper/Line.js +++ b/src/chart/helper/Line.js @@ -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); diff --git a/test/graph-simple.html b/test/graph-simple.html index 8478a3f9ba..0f95eb7093 100644 --- a/test/graph-simple.html +++ b/test/graph-simple.html @@ -70,9 +70,6 @@ } } }, - lineStyle: { - width: 10 - }, focusNodeAdjacency: focusNodeAdjacency, data: [{ name: '节点1', @@ -92,7 +89,13 @@ x: 550, y: 500 }], - // links: [], + lineStyle: { + normal: { + width: 3, + color: '#184029', + curveness: 0 + } + }, links: [{ source: 0, target: 1, @@ -149,12 +152,7 @@ }, { source: '节点1', target: '节点4' - }], - lineStyle: { - normal: { - curveness: 0 - } - } + }] } ] }; From e4637506d32bd068bd3cf6c6a29b8197a5d1314c Mon Sep 17 00:00:00 2001 From: sushuang Date: Wed, 23 Jan 2019 00:48:00 +0800 Subject: [PATCH 4/7] Lift axis line arrow over splitLine and tick. --- src/component/axis/AxisBuilder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/component/axis/AxisBuilder.js b/src/component/axis/AxisBuilder.js index 33be699021..9e66ea12e6 100644 --- a/src/component/axis/AxisBuilder.js +++ b/src/component/axis/AxisBuilder.js @@ -230,7 +230,8 @@ var builders = { symbol.attr({ rotation: point.rotate, position: pos, - silent: true + silent: true, + z2: 11 }); this.group.add(symbol); } From 179a29d9fa015d837f4eb3f04438310e418a8f0d Mon Sep 17 00:00:00 2001 From: sushuang Date: Wed, 23 Jan 2019 20:50:23 +0800 Subject: [PATCH 5/7] tweak test --- test/axis-extrema.html | 2 +- test/axis-interval.html | 2 +- test/custom-feature.html | 114 +++++---------------------------------- test/dataset-charts.html | 6 +++ test/lib/reset.css | 7 ++- test/tmp-base.html | 4 -- 6 files changed, 24 insertions(+), 111 deletions(-) diff --git a/test/axis-extrema.html b/test/axis-extrema.html index e7e2634f4e..80821b30f7 100644 --- a/test/axis-extrema.html +++ b/test/axis-extrema.html @@ -50,7 +50,7 @@

cartesian category axis | xAxis: {min: undefined, max: undefined}

-

cartesian category axis | xAxis.data is empty

+

cartesian category axis | xAxis.data is empty (always show nothing if dataZoom)

cartesian category axis | xAxis: {min: -10, max: '类目3'}

diff --git a/test/axis-interval.html b/test/axis-interval.html index a5c49ba42f..7e73a22873 100644 --- a/test/axis-interval.html +++ b/test/axis-interval.html @@ -114,7 +114,7 @@

[ Test time axis interval ]    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 }); }); diff --git a/test/custom-feature.html b/test/custom-feature.html index 7c568b18e5..7ec76969af 100644 --- a/test/custom-feature.html +++ b/test/custom-feature.html @@ -32,10 +32,6 @@ @@ -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 }); @@ -129,76 +125,6 @@ }); }); }); - - - - - - - @@ -206,14 +132,6 @@ - - - - - - - -