You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2018/04/05 20:35:33 UTC
[incubator-echarts] 03/09: Fix lines rendering in large but not
incrementalDisplayable mode.
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 00b93a2e431141740ad582aa5730c41439ed5223
Author: sushuang <su...@gmail.com>
AuthorDate: Tue Apr 3 14:31:40 2018 +0800
Fix lines rendering in large but not incrementalDisplayable mode.
---
src/chart/lines/linesLayout.js | 2 +-
test/-cases.js | 3 +
test/line-large.html | 2 +-
test/lines-flight.html | 2 +-
test/lines-stream-large.html | 143 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 149 insertions(+), 3 deletions(-)
diff --git a/src/chart/lines/linesLayout.js b/src/chart/lines/linesLayout.js
index 7b5666d..6fc5602 100644
--- a/src/chart/lines/linesLayout.js
+++ b/src/chart/lines/linesLayout.js
@@ -23,7 +23,7 @@ export default {
points = new Float32Array(segCount + totalCoordsCount * 2);
}
else {
- points = new Float32Array(segCount * 2);
+ points = new Float32Array(segCount * 4);
}
var offset = 0;
diff --git a/test/-cases.js b/test/-cases.js
index d0d2353..826f18d 100644
--- a/test/-cases.js
+++ b/test/-cases.js
@@ -34,11 +34,14 @@
name: 'stream-cases',
whiteList: [
'lines-ny-appendData.html',
+ 'scatter-stream-large.html',
+ 'scatter-stream-not-large.html',
'scatter-random-stream.html',
'scatter-random-stream-fix-axis.html',
'scatter-gps.html',
'scatter-weibo.html',
'lines-flight.html',
+ 'lines-stream-large.html',
'lines-stream-not-large.html',
'stream-filter.html',
'scatter-stream-visual.html'
diff --git a/test/line-large.html b/test/line-large.html
index d37a945..9921ea8 100644
--- a/test/line-large.html
+++ b/test/line-large.html
@@ -59,7 +59,7 @@
},
yAxis: {
},
- dataZoom: [{}, {type: 'inside'}],
+ dataZoom: [{end: 90}, {type: 'inside', end: 90}],
series: [{
name: 'large-line',
type: 'line',
diff --git a/test/lines-flight.html b/test/lines-flight.html
index 4c2c802..c495947 100644
--- a/test/lines-flight.html
+++ b/test/lines-flight.html
@@ -111,7 +111,7 @@
largeThreshold: 100,
lineStyle: {
normal: {
- opacity: 0.05,
+ opacity: 0.5,
width: 0.5,
curveness: 0.3
}
diff --git a/test/lines-stream-large.html b/test/lines-stream-large.html
new file mode 100644
index 0000000..a0e209d
--- /dev/null
+++ b/test/lines-stream-large.html
@@ -0,0 +1,143 @@
+<html>
+ <head>
+ <meta charset='utf-8'>
+ <script src='lib/esl.js'></script>
+ <script src='lib/config.js'></script>
+ <script src='lib/jquery.min.js'></script>
+ <script src='lib/testHelper.js'></script>
+ <link rel="stylesheet" href="lib/reset.css" />
+ <meta name='viewport' content='width=device-width, initial-scale=1' />
+ </head>
+ <body>
+ <style>
+ html, body, #main0 {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ }
+ </style>
+ <div id='main0'></div>
+ <script>
+
+ var xs = [440000, 450000];
+ var ys = [4368000, 4537000];
+
+ require([
+ 'echarts'
+ ], function (echarts) {
+
+ $.get('../map/json/world.json', function (worldJson) {
+ echarts.registerMap('world', worldJson);
+
+ var linesCount = 35663;
+ var chart;
+
+ var routes = [];
+
+ var lngStep = 0.01;
+ var lng0 = -160;
+ var lng1 = lng0 + linesCount * lngStep;
+
+ for (var i = 0; i < linesCount; i++) {
+ var lng = lng0 + i * lngStep;
+ var lat0 = 0;
+ var lat1 = 90;
+
+ // if (i % 1000 < 500) {
+ // lat0 = 30;
+ // lat1 = 120;
+ // }
+ routes.push([[lng, lat0], [lng, lat1]]);
+ }
+
+ var option = {
+ title: {
+ text: 'World Flights',
+ left: 'center',
+ textStyle: {
+ color: '#eee'
+ }
+ },
+ backgroundColor: '#003',
+ tooltip: {
+ formatter: function (param) {
+ return 'Line: ' + param.dataIndex;
+ }
+ },
+ geo: {
+ map: 'world',
+ left: 0,
+ right: 0,
+ zoom: 0.3,
+ roam: true,
+ silent: true,
+ itemStyle: {
+ normal: {
+ borderColor: '#003',
+ color: '#005'
+ }
+ }
+ },
+ series: [{
+ type: 'lines',
+ coordinateSystem: 'geo',
+ blendModel: 'lighter',
+ data: routes,
+ large: true,
+ // large: false,
+ largeThreshold: 0,
+ // progressive: 5e3,
+ progressiveThreshold: 101,
+ lineStyle: {
+ normal: {
+ opacity: 1,
+ width: 1,
+ // curveness: 0.3
+ }
+ },
+ // blendMode: 'lighter'
+ }, {
+ type: 'scatter',
+ coordinateSystem: 'geo',
+ symbolSize: 5,
+ color: ['green'],
+ data: [
+ {
+ value: [lng0, 30],
+ label: {
+ show: true,
+ position: 'top',
+ formatter: 'longitude start'
+ }
+ }, {
+ value: [lng1, 30],
+ label: {
+ show: true,
+ position: 'top',
+ formatter: 'longitude end'
+ }
+ }
+ ]
+ }]
+ };
+
+ var chart = testHelper.create(echarts, 'main0', {
+ title: [
+ linesCount + ' lines should be rendered vertically side by side ',
+ 'from the left green point to the right green point, NO GAP.',
+ '( large:true and el.incremetal = true) ',
+ 'And check roam.'
+ ],
+ option: option,
+ height: 550
+ });
+ chart.on('finished', function () {
+ console.log('finished');
+ });
+
+ });
+ });
+
+ </script>
+ </body>
+</html>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
sushuang@apache.org.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org