[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: sushuangAuthorDate: 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: sushuangAuthorDate: 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
[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: sushuangAuthorDate: 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] 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: sushuangAuthorDate: 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: { +
[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] 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: sushuangAuthorDate: 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', -//
[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: deqingliAuthorDate: 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": { +