[incubator-echarts] branch master updated: fix node reorder of the sankey view when resize the diagram
This is an automated email from the ASF dual-hosted git repository. deqingli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git The following commit(s) were added to refs/heads/master by this push: new a6da144 fix node reorder of the sankey view when resize the diagram new bf0a02c Merge branch 'master' of https://github.com/apache/incubator-echarts a6da144 is described below commit a6da14409985bf6a6c09ab004c5a52039ade5263 Author: deqingli AuthorDate: Wed Apr 18 15:53:49 2018 +0800 fix node reorder of the sankey view when resize the diagram --- src/chart/sankey/SankeyView.js | 1 - src/chart/sankey/sankeyLayout.js | 2 +- src/chart/sankey/sankeyVisual.js | 17 +++-- test/sankey-test.html| 15 +-- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/chart/sankey/SankeyView.js b/src/chart/sankey/SankeyView.js index 2c92f27..639a424 100644 --- a/src/chart/sankey/SankeyView.js +++ b/src/chart/sankey/SankeyView.js @@ -60,7 +60,6 @@ export default echarts.extendChartView({ // generate a bezire Curve for each edge graph.eachEdge(function (edge) { var curve = new SankeyShape(); - curve.dataIndex = edge.dataIndex; curve.seriesIndex = seriesModel.seriesIndex; curve.dataType = 'edge'; diff --git a/src/chart/sankey/sankeyLayout.js b/src/chart/sankey/sankeyLayout.js index a280414..0266998 100644 --- a/src/chart/sankey/sankeyLayout.js +++ b/src/chart/sankey/sankeyLayout.js @@ -395,7 +395,7 @@ function ascendingDepth(a, b) { } function ascending(a, b) { -return a < b ? -1 : a > b ? 1 : a === b ? 0 : NaN; +return a - b; } function getEdgeValue(edge) { diff --git a/src/chart/sankey/sankeyVisual.js b/src/chart/sankey/sankeyVisual.js index 5462658..72b5175 100644 --- a/src/chart/sankey/sankeyVisual.js +++ b/src/chart/sankey/sankeyVisual.js @@ -11,13 +11,18 @@ export default function (ecModel, payload) { var graph = seriesModel.getGraph(); var nodes = graph.nodes; if (nodes.length) { -nodes.sort(function (a, b) { -return a.getLayout().value - b.getLayout().value; +var minValue = Infinity; +var maxValue = -Infinity; +zrUtil.each(nodes, function (node) { +var nodeValue = node.getLayout().value; +if (nodeValue < minValue) { +minValue = nodeValue; +} +if (nodeValue > maxValue) { +maxValue = nodeValue; +} }); - -var minValue = nodes[0].getLayout().value; -var maxValue = nodes[nodes.length - 1].getLayout().value; - + zrUtil.each(nodes, function (node) { var mapping = new VisualMapping({ type: 'color', diff --git a/test/sankey-test.html b/test/sankey-test.html index 3ecdaa7..aa17c35 100644 --- a/test/sankey-test.html +++ b/test/sankey-test.html @@ -119,6 +119,9 @@ }, { name: 'c' +}, +{ +name: 'e' } ], links: [ @@ -128,16 +131,11 @@ value: 5 }, { -source: 'a', +source: 'e', target: 'b', value: 3 }, { -source: 'b', -target: 'a', -value: 8 -}, -{ source: 'a', target: 'b1', value: 3 @@ -151,6 +149,11 @@ source: 'b1', target: 'c', value: 2 +}, +{ +source: 'b', +target: 'c', +value: 1 } ] }; -- To stop receiving notification emails like this one, please contact deqin...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] branch master updated: test sankey diagram jumps when switching between series #3543
This is an automated email from the ASF dual-hosted git repository. deqingli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git The following commit(s) were added to refs/heads/master by this push: new ea62bae test sankey diagram jumps when switching between series #3543 ea62bae is described below commit ea62bae2b5981a1bc422e04c12daa6ff5d1f11ce Author: deqingli AuthorDate: Wed Apr 18 17:40:24 2018 +0800 test sankey diagram jumps when switching between series #3543 --- test/sankey-jume.html | 849 ++ 1 file changed, 849 insertions(+) diff --git a/test/sankey-jume.html b/test/sankey-jume.html new file mode 100644 index 000..0e16996 --- /dev/null +++ b/test/sankey-jume.html @@ -0,0 +1,849 @@ + + + + + + + + + + +html, body, #main { +width: 100%; +height: 90%; +/*border: 1px solid #000;*/ +} + + + +require([ +'echarts' +// 'echarts/chart/sankey', +// 'echarts/component/tooltip' +], function (echarts) { + +var chart = echarts.init(document.getElementById('main'), null, { + +}); + +window.onresize = function () { +chart.resize(); +}; + +chart.on('click', function (params) { +console.log(params, params.data); +}); + +var option = { +"backgroundColor": "#404a59", +"animation": false, +"tooltip": { +"showContent": true, +"borderRadius": 0, +"padding": 4.645544922419401, +"textStyle": { +"fontSize": "10", +"fontWeight": "normal" +} +}, +"legend": { +"show": true, +"x": "center", +"y": "bottom", +"padding": 6.194059896559202, +"itemGap": 6.194059896559202, +"data": [ +{ +"name": "Number of tourists", +"icon": "circle" +}, +{ +"name": "Overnights", +"icon": "circle" +} +], +"itemWidth": 14.6455449224194, +"itemHeight": 13.097029948279602, +"orient": "horizontal", +"textStyle": { +"fontSize": "12", +"fontWeight": "normal" +}, +"selectedMode": "single" +}, +"title": { +"text": "Foreign tourist inflow – Q1 2016", +"subtext": "", +"sublink": "https://pioneers.io/festival2016/pioneers500/top70/";, +"x": "center", +"y": "top", +"textStyle": { +"fontSize": "24", +"fontWeight": "normal" +}, +"subtextStyle": { +"fontSize": 13, +"fontWeight": "bold" +} +}, +"series": [ +{ +"name": "Number of tourists", +"type": "sankey", +"top": 100, +"left": 20, +"width": "30%", +"bottom": 50, +"zlevel": 1, +"nodeWidth": 25, +"nodeGap": 11, +"data": [ +{ +"name": " Hungary", +"label": { +"normal": { +"position"
[incubator-echarts] branch master updated (ea62bae -> e5fdb08)
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git. from ea62bae test sankey diagram jumps when switching between series #3543 new 1bb1f9f Tweak for gl. new ed636dd Merge branch 'master' of https://github.com/apache/incubator-echarts new 1d1d1e2 Merge branch 'master' of https://github.com/apache/incubator-echarts new e5fdb08 Expose api of auto tick strategy and tweak splitArea logic. The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/component/axis/CartesianAxisView.js | 2 +- src/coord/Axis.js | 113 +--- src/coord/axisTickLabelBuilder.js | 13 ++-- test/axis-interval2.html| 67 +++ 4 files changed, 152 insertions(+), 43 deletions(-) -- To stop receiving notification emails like this one, please contact sushu...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] 02/04: Merge branch 'master' of https://github.com/apache/incubator-echarts
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit ed636dd9d6682ab5edf8ca83c83751163a5e66b2 Merge: 1bb1f9f bf0a02c Author: sushuang AuthorDate: Wed Apr 18 17:16:22 2018 +0800 Merge branch 'master' of https://github.com/apache/incubator-echarts src/chart/sankey/SankeyView.js | 1 - src/chart/sankey/sankeyLayout.js | 2 +- src/chart/sankey/sankeyVisual.js | 17 +++-- test/sankey-test.html| 15 +-- 4 files changed, 21 insertions(+), 14 deletions(-) -- To stop receiving notification emails like this one, please contact sushu...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] 04/04: Expose api of auto tick strategy and tweak splitArea logic.
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit e5fdb088e88bee2b4c8e070e2ccb68d00b41eee9 Author: sushuang AuthorDate: Wed Apr 18 22:40:14 2018 +0800 Expose api of auto tick strategy and tweak splitArea logic. --- src/component/axis/CartesianAxisView.js | 2 +- src/coord/Axis.js | 96 - src/coord/axisTickLabelBuilder.js | 13 +++-- test/axis-interval2.html| 67 +++ 4 files changed, 136 insertions(+), 42 deletions(-) diff --git a/src/component/axis/CartesianAxisView.js b/src/component/axis/CartesianAxisView.js index 10f60f4..0e80f0e 100644 --- a/src/component/axis/CartesianAxisView.js +++ b/src/component/axis/CartesianAxisView.js @@ -203,7 +203,7 @@ var CartesianAxisView = AxisView.extend({ } var tickValue = ticksCoords[i - 1].tickValue; -newSplitAreaColors.set(tickValue, colorIndex); +tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); this._axisGroup.add(new graphic.Rect({ anid: 'area_' + tickValue, diff --git a/src/coord/Axis.js b/src/coord/Axis.js index 88a22b8..4ae58e2 100644 --- a/src/coord/Axis.js +++ b/src/coord/Axis.js @@ -1,6 +1,10 @@ import {each, map} from 'zrender/src/core/util'; import {linearMap, getPixelPrecision} from '../util/number'; -import {createAxisTicks, createAxisLabels} from './axisTickLabelBuilder'; +import { +createAxisTicks, +createAxisLabels, +calculateCategoryInterval +} from './axisTickLabelBuilder'; var NORMALIZED_EXTENT = [0, 1]; @@ -151,7 +155,9 @@ Axis.prototype = { * `boundaryGap:true` of category axis and splitLine and splitArea. * @param {Object} [opt] * @param {number} [opt.tickModel=axis.model.getModel('axisTick')] - * @param {boolean} [opt.clamp] If `false`, clip. If `true`, clamp. + * @param {boolean} [opt.clamp] If `true`, the first and the last + *tick must be at the axis end points. Otherwise, clip ticks + *that outside the axis extent. * @return {Array.} [{ * coord: ..., * tickValue: ... @@ -237,7 +243,17 @@ Axis.prototype = { * @abstract * @return {number} Get axis rotate, by degree. */ -getRotate: null +getRotate: null, + +/** + * Only be called in category axis. + * Can be overrided, consider other axes like in 3D. + * @param {boolean} hideLabel + * @return {number} Auto interval for cateogry axis tick and label + */ +calculateCategoryInterval: function (hideLabel) { +return calculateCategoryInterval(this, hideLabel); +} }; @@ -260,40 +276,48 @@ function fixExtentWithBands(extent, nTick) { // case). function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) { var ticksLen = ticksCoords.length; -if (axis.onBand && !alignWithLabel && ticksLen) { -var axisExtent = axis.getExtent(); -var last; -if (ticksLen === 1) { -ticksCoords[0].coord = axisExtent[0]; -last = ticksCoords[1] = {coord: axisExtent[0]}; -} -else { -var shift = (ticksCoords[1].coord - ticksCoords[0].coord); -each(ticksCoords, function (ticksItem) { -ticksItem.coord -= shift / 2; -var tickCategoryInterval = tickCategoryInterval || 0; -// Avoid split a single data item when odd interval. -if (tickCategoryInterval % 2 > 0) { -ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2); -} -}); -last = {coord: ticksCoords[ticksLen - 1].coord + shift}; -ticksCoords.push(last); -} -var inverse = axisExtent[0] > axisExtent[1]; -if (inverse -? ticksCoords[0].coord > axisExtent[0] -: ticksCoords[0].coord < axisExtent[0] -) { -clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift(); -} -if (inverse -? last.coord < axisExtent[1] -: last.coord > axisExtent[1] -) { -clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop(); -} +if (!axis.onBand || alignWithLabel || !ticksLen) { +return; +} + +var axisExtent = axis.getExtent(); +var last; +if (ticksLen === 1) { +ticksCoords[0].coord = axisExtent[0]; +last = ticksCoords[1] = {coord: axisExtent[0]}; +} +else { +var shift = (ticksCoords[1].coord - ticksCoords[0].coord); +each(ticksCoords, function (ticksItem) { +ticksItem.coord -= shift / 2; +var tickCategoryInterval = tickCategoryInterval || 0; +// Avoid split a single data item when odd inte
[incubator-echarts] 01/04: Tweak for gl.
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit 1bb1f9ff491c6d30716a153b4c2d0e7e1652f2c6 Author: sushuang AuthorDate: Wed Apr 18 17:16:04 2018 +0800 Tweak for gl. --- src/coord/Axis.js | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/coord/Axis.js b/src/coord/Axis.js index f308298..88a22b8 100644 --- a/src/coord/Axis.js +++ b/src/coord/Axis.js @@ -160,7 +160,7 @@ Axis.prototype = { getTicksCoords: function (opt) { opt = opt || {}; -var tickModel = opt.tickModel || this.model.getModel('axisTick'); +var tickModel = opt.tickModel || this.getTickModel(); var result = createAxisTicks(this, tickModel); var ticks = result.ticks; @@ -191,11 +191,26 @@ Axis.prototype = { return createAxisLabels(this).labels; }, +/** + * @return {module:echarts/coord/model/Model} + */ getLabelModel: function () { return this.model.getModel('axisLabel'); }, /** + * Notice here we only get the default tick model. For splitLine + * or splitArea, we should pass the splitLineModel or splitAreaModel + * manually when calling `getTicksCoords`. + * In GL, this method may be overrided to: + * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` + * @return {module:echarts/coord/model/Model} + */ +getTickModel: function () { +return this.model.getModel('axisTick'); +}, + +/** * Get width of band * @return {number} */ -- To stop receiving notification emails like this one, please contact sushu...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] 03/04: Merge branch 'master' of https://github.com/apache/incubator-echarts
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit 1d1d1e2d511c513039a369b4ed1948e9b5c732da Merge: ed636dd ea62bae Author: sushuang AuthorDate: Wed Apr 18 18:20:27 2018 +0800 Merge branch 'master' of https://github.com/apache/incubator-echarts test/sankey-jume.html | 849 ++ 1 file changed, 849 insertions(+) -- To stop receiving notification emails like this one, please contact sushu...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] branch master updated (e5fdb08 -> 5f156ad)
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git. from e5fdb08 Expose api of auto tick strategy and tweak splitArea logic. new faa78f7 Disable visualMap for large mode. And add test case for bar stream. new 5f156ad Fix remove of bar and candlestick. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/bar/BarView.js | 20 +++-- src/chart/candlestick/CandlestickView.js | 15 ++-- src/component/visualMap/visualEncoding.js| 5 +- src/layout/barGrid.js| 1 - src/visual/visualSolution.js | 3 +- test/-cases.js | 3 + test/bar-stream-large.html | 85 + test/{bar-large1.html => bar-stream-large1.html} | 26 +-- test/candlestick-large2.html | 97 9 files changed, 176 insertions(+), 79 deletions(-) create mode 100644 test/bar-stream-large.html rename test/{bar-large1.html => bar-stream-large1.html} (84%) -- To stop receiving notification emails like this one, please contact sushu...@apache.org. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
[incubator-echarts] 02/02: Fix remove of bar and candlestick.
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit 5f156ad45f4ff03efe7812e525edabb5abef8747 Author: sushuang AuthorDate: Thu Apr 19 01:35:09 2018 +0800 Fix remove of bar and candlestick. --- src/chart/bar/BarView.js | 20 -- src/chart/candlestick/CandlestickView.js | 15 +- test/-cases.js | 1 + test/bar-stream-large.html | 16 +-- test/{bar-large1.html => bar-stream-large1.html} | 26 +++- 5 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/chart/bar/BarView.js b/src/chart/bar/BarView.js index 01ad899..7ee5fc5 100644 --- a/src/chart/bar/BarView.js +++ b/src/chart/bar/BarView.js @@ -152,17 +152,15 @@ export default echarts.extendChartView({ _clear: function (ecModel) { var group = this.group; var data = this._data; -if (ecModel && ecModel.get('animation')) { -if (data) { -data.eachItemGraphicEl(function (el) { -if (el.type === 'sector') { -removeSector(el.dataIndex, ecModel, el); -} -else { -removeRect(el.dataIndex, ecModel, el); -} -}); -} +if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) { +data.eachItemGraphicEl(function (el) { +if (el.type === 'sector') { +removeSector(el.dataIndex, ecModel, el); +} +else { +removeRect(el.dataIndex, ecModel, el); +} +}); } else { group.removeAll(); diff --git a/src/chart/candlestick/CandlestickView.js b/src/chart/candlestick/CandlestickView.js index 511dcca..d2a96b8 100644 --- a/src/chart/candlestick/CandlestickView.js +++ b/src/chart/candlestick/CandlestickView.js @@ -39,11 +39,6 @@ var CandlestickView = ChartView.extend({ } }, -_clear: function () { -this.group.removeAll(); -this._data = null; -}, - _renderNormal: function (seriesModel) { var data = seriesModel.getData(); var oldData = this._data; @@ -129,12 +124,12 @@ var CandlestickView = ChartView.extend({ }, remove: function (ecModel) { -var group = this.group; -var data = this._data; +this._clear(); +}, + +_clear: function () { +this.group.removeAll(); this._data = null; -data && data.eachItemGraphicEl(function (el) { -el && group.remove(el); -}); }, dispose: zrUtil.noop diff --git a/test/-cases.js b/test/-cases.js index a5fb568..38324e8 100644 --- a/test/-cases.js +++ b/test/-cases.js @@ -41,6 +41,7 @@ 'scatter-gps.html', 'scatter-weibo.html', 'bar-stream-large.html', +'bar-stream-large1.html', 'candlestick-large1.html', 'lines-flight.html', 'lines-stream-large.html', diff --git a/test/bar-stream-large.html b/test/bar-stream-large.html index 9164410..00fa074 100644 --- a/test/bar-stream-large.html +++ b/test/bar-stream-large.html @@ -10,13 +10,15 @@ -html, body, #main0 { -width: 100%; -height: 100%; -margin: 0; +#snapshot { +width: 150; +height: 100; +background: #fff; +border: 5px solid rgba(0,0,0,0.5); } + require(['echarts'], function (echarts) { @@ -61,7 +63,7 @@ '(1) Check all bars rendered (full of xAxis)', '(2) And check roam.', '(3) Check click legend', -'(4) "finished" should be printed on console' +'(4) Check snapshot rendering when "finished"' ], option: option, info: { @@ -71,7 +73,9 @@ }); chart.on('finished', function () { -console.log('finished'); +var url = chart.getDataURL(); +var snapshotEl = document.getElementById('snapshot'); +snapshotEl.src = url; }); }); diff --git a/test/bar-large1.html b/test/bar-stream-large1.html similarity index 84% rename from test/bar-large1.html rename to test/bar-stream-large1.html index a2114b8..5ce604a 100644 --- a/test/bar-large1.html +++ b/test/bar-stream-large1.html @@ -15,9 +15,18 @@ background: #146402; color: #fff; } + +#snapshot { +width: 150; +
[incubator-echarts] 01/02: Disable visualMap for large mode. And add test case for bar stream.
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git commit faa78f738a722d7f2173fe765b654dbe4bae25d9 Author: sushuang AuthorDate: Thu Apr 19 01:11:17 2018 +0800 Disable visualMap for large mode. And add test case for bar stream. --- src/component/visualMap/visualEncoding.js | 5 +- src/layout/barGrid.js | 1 - src/visual/visualSolution.js | 3 +- test/-cases.js| 2 + test/bar-stream-large.html| 81 ++ test/candlestick-large2.html | 97 +++ 6 files changed, 136 insertions(+), 53 deletions(-) diff --git a/src/component/visualMap/visualEncoding.js b/src/component/visualMap/visualEncoding.js index f19c78c..45be9fb 100644 --- a/src/component/visualMap/visualEncoding.js +++ b/src/component/visualMap/visualEncoding.js @@ -10,7 +10,10 @@ echarts.registerVisual(VISUAL_PRIORITY, { reset: function (seriesModel, ecModel) { var resetDefines = []; ecModel.eachComponent('visualMap', function (visualMapModel) { -if (!visualMapModel.isTargetSeries(seriesModel)) { +var pipelineContext = seriesModel.pipelineContext; +if (!visualMapModel.isTargetSeries(seriesModel) +|| (pipelineContext && pipelineContext.large) +) { return; } diff --git a/src/layout/barGrid.js b/src/layout/barGrid.js index f23c3fb..2dab497 100644 --- a/src/layout/barGrid.js +++ b/src/layout/barGrid.js @@ -367,7 +367,6 @@ export var largeLayout = { return {progress: progress}; function progress(params, data) { - var largePoints = new LargeArr(params.count * 2); var dataIndex; var coord = []; diff --git a/src/visual/visualSolution.js b/src/visual/visualSolution.js index 13446c6..80de6d4 100644 --- a/src/visual/visualSolution.js +++ b/src/visual/visualSolution.js @@ -170,7 +170,8 @@ export function incrementalApplyVisual(stateList, visualMappings, getValueState, data.setItemVisual(dataIndex, key, value); } -for (var dataIndex = params.start; dataIndex < params.end; dataIndex++) { +var dataIndex; +while ((dataIndex = params.next()) != null) { var rawDataItem = data.getRawDataItem(dataIndex); // Consider performance diff --git a/test/-cases.js b/test/-cases.js index 826f18d..a5fb568 100644 --- a/test/-cases.js +++ b/test/-cases.js @@ -40,6 +40,8 @@ 'scatter-random-stream-fix-axis.html', 'scatter-gps.html', 'scatter-weibo.html', +'bar-stream-large.html', +'candlestick-large1.html', 'lines-flight.html', 'lines-stream-large.html', 'lines-stream-not-large.html', diff --git a/test/bar-stream-large.html b/test/bar-stream-large.html new file mode 100644 index 000..9164410 --- /dev/null +++ b/test/bar-stream-large.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + +html, body, #main0 { +width: 100%; +height: 100%; +margin: 0; +} + + + + +require(['echarts'], function (echarts) { + +var count = 2e5; + +var data = []; + +for (var i = 0; i < count; i++) { +data.push(['c' + i, Math.sin(i / 180 * Math.PI)]); +} + +var option = { +tooltip: { +trigger: 'axis' +}, +legend: {}, +xAxis: { +type: 'category', +min: 0, +max: count - 1, +axisLabel: { +showMaxLabel: true, +showMinLabel: true +} +}, +yAxis: {}, +dataZoom: [{}, {type: 'inside'}], +series: [{ +type: 'bar', +name: 'bar', +color: ['green'], +progressiveChunkMode: 'sequential', +large: true, +data: data +}] +}; + +var chart = testHelper.create(echarts, 'main0', { +title: [ +count + ' points should be rendered from left to right.', +'(1) Check all bars rendered (full of xAxis)', +'(2) And check roam.', +'(3) Check click legend', +'(4) "finished" should be printed on console' +], +option: option, +info: { +xAxis: optio
[incubator-echarts] branch master updated: Fix #8003 (yAxis extent do not updated when some of stacked bar series hide)
This is an automated email from the ASF dual-hosted git repository. sushuang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git The following commit(s) were added to refs/heads/master by this push: new 2fddc7f Fix #8003 (yAxis extent do not updated when some of stacked bar series hide) 2fddc7f is described below commit 2fddc7fd0463aac23652d1e3eefb7b28411f467a Author: sushuang AuthorDate: Thu Apr 19 03:47:35 2018 +0800 Fix #8003 (yAxis extent do not updated when some of stacked bar series hide) --- src/data/List.js | 35 - test/bar-stack.html | 47 ++-- test/candlestick-large2.html | 4 ++-- test/lib/reset.css | 3 ++- 4 files changed, 31 insertions(+), 58 deletions(-) diff --git a/src/data/List.js b/src/data/List.js index 2ee3f69..688e3b6 100644 --- a/src/data/List.js +++ b/src/data/List.js @@ -47,21 +47,29 @@ function cloneChunk(originalChunk) { } var TRANSFERABLE_PROPERTIES = [ -'hasItemOption', '_nameList', '_idList', '_calculationInfo', '_invertedIndicesMap', -'_rawData', '_rawExtent', '_chunkSize', '_chunkCount', -'_dimValueGetter', '_count', '_rawCount', '_nameDimIdx', '_idDimIdx' +'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', +'_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter', +'_count', '_rawCount', '_nameDimIdx', '_idDimIdx' +]; +var CLONE_PROPERTIES = [ +'_extent', '_approximateExtent', '_rawExtent' ]; -function transferProperties(a, b) { -zrUtil.each(TRANSFERABLE_PROPERTIES.concat(b.__wrappedMethods || []), function (propName) { -if (b.hasOwnProperty(propName)) { -a[propName] = b[propName]; +function transferProperties(target, source) { +zrUtil.each(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { +if (source.hasOwnProperty(propName)) { +target[propName] = source[propName]; } }); -a.__wrappedMethods = b.__wrappedMethods; -} +target.__wrappedMethods = source.__wrappedMethods; + +zrUtil.each(CLONE_PROPERTIES, function (propName) { +target[propName] = zrUtil.clone(source[propName]); +}); +target._calculationInfo = zrUtil.extend(source._calculationInfo); +} @@ -1441,15 +1449,17 @@ function cloneListForMapAndSample(original, excludeDimensions) { var storage = list._storage = {}; var originalStorage = original._storage; -var rawExtent = zrUtil.extend({}, original._rawExtent); // Init storage for (var i = 0; i < allDimensions.length; i++) { var dim = allDimensions[i]; if (originalStorage[dim]) { +// Notice that we do not reset invertedIndicesMap here, becuase +// there is no scenario of mapping or sampling ordinal dimension. if (zrUtil.indexOf(excludeDimensions, dim) >= 0) { storage[dim] = cloneDimStore(originalStorage[dim]); -rawExtent[dim] = getInitialExtent(); +list._rawExtent[dim] = getInitialExtent(); +list._extent[dim] = null; } else { // Direct reference for other dimensions @@ -1855,9 +1865,6 @@ listProto.cloneShallow = function (list) { } list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; -list._extent = zrUtil.clone(this._extent); -list._approximateExtent = zrUtil.clone(this._approximateExtent); - return list; }; diff --git a/test/bar-stack.html b/test/bar-stack.html index 3503408..59e554d 100644 --- a/test/bar-stack.html +++ b/test/bar-stack.html @@ -12,57 +12,19 @@ -h1 { -line-height: 60px; -height: 60px; -background: #146402; -text-align: center; -font-weight: bold; -color: #eee; -font-size: 14px; -} -.chart { -height: 500px; -} - - - + require([ 'echarts' -// 'echarts/chart/line', -// 'echarts/chart/bar', -// 'echarts/chart/pie', -// 'echarts/chart/scatter', -// 'echarts/chart/map', -// 'echarts/chart/parallel', -// 'echarts/chart/radar', -// 'echarts/component/grid', -// 'echarts/component/polar', -// 'echarts/component/geo', -// 'echarts/component/singleAxis', -// 'echarts/component/legend', -// 'echarts/component/tooltip', -// 'echarts/component/toolbox', -// 'echarts/component/visualMap', -// 'echarts/component/dataZoom' ], func