You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/03/30 05:45:17 UTC
[echarts] branch add-test-for-line-extraneous updated: test(line):
add test case for line remove animation.
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch add-test-for-line-extraneous
in repository https://gitbox.apache.org/repos/asf/echarts.git
The following commit(s) were added to refs/heads/add-test-for-line-extraneous by this push:
new d010376 test(line): add test case for line remove animation.
d010376 is described below
commit d010376539659f359d983bf6ae7d01fddac0ea77
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Mar 30 13:44:08 2021 +0800
test(line): add test case for line remove animation.
---
test/line-extraneous.html | 274 +++++++++++++++++++++++++++++
test/lines-extraneous.html | 146 ---------------
test/runTest/actions/__meta__.json | 1 +
test/runTest/actions/line-extraneous.json | 1 +
test/runTest/actions/lines-extraneous.json | 1 -
5 files changed, 276 insertions(+), 147 deletions(-)
diff --git a/test/line-extraneous.html b/test/line-extraneous.html
new file mode 100644
index 0000000..884c19d
--- /dev/null
+++ b/test/line-extraneous.html
@@ -0,0 +1,274 @@
+<!DOCTYPE html>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+
+<html>
+
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <script src="lib/esl.js"></script>
+ <script src="lib/config.js"></script>
+ <script src="lib/facePrint.js"></script>
+ <script src="lib/testHelper.js"></script>
+ <link rel="stylesheet" href="lib/reset.css" />
+</head>
+
+<body>
+ <style>
+ .test-title {
+ background: #146402;
+ color: #fff;
+ }
+ </style>
+
+
+ <div id="main0"></div>
+ <div id="main1"></div>
+
+ <script>
+
+ /**
+ * Related issues:
+ * - https://github.com/apache/incubator-echarts/issues/10228
+ * - https://github.com/apache/incubator-echarts/issues/11633
+ * - https://github.com/apache/incubator-echarts/issues/12164
+ * - https://github.com/apache/incubator-echarts/issues/12433
+ */
+ require([
+ 'echarts'
+ ], function (echarts) {
+ var chart;
+ var myChart;
+
+ const datasetSource1 = [['2019-04-14', 17], ['2019-04-16', 13], ['2019-04-17', 5]];
+ const datasetSource2 = [['2019-04-13', 0], ['2019-04-18', 23]];
+
+
+ const option1 = {
+ dataset: [
+ {
+ source: datasetSource1,
+ sourceHeader: false
+ }
+ ],
+ dataZoom: [
+ { show: true }
+ ],
+ xAxis: {
+ type: 'time',
+ min: '2019-04-15',
+ max: '2019-04-18',
+ },
+ yAxis: [
+ {
+ scale: true,
+ type: 'value'
+ }
+ ],
+ series: [
+ {
+ type: 'line',
+ showSymbol: false,
+ animation: false,
+ }
+ ]
+ };
+
+ const option2 = {
+ dataset: [
+ {
+ source: datasetSource2,
+ sourceHeader: false
+ }
+ ],
+ dataZoom: [
+ {
+ show: true,
+ start: 0,
+ end: 100,
+ }
+ ],
+ xAxis: {
+ type: 'time',
+ min: '2019-04-12',
+ max: '2019-04-19',
+ },
+ yAxis: [
+ {
+ scale: true,
+ type: 'value'
+ }
+ ],
+ series: [
+ {
+ type: 'line',
+ showSymbol: false,
+ }
+ ]
+ };
+
+ chart = myChart = testHelper.create(echarts, 'main0', {
+ title: [
+ 'Lines series should not show extraneous points when updating options',
+ 'Only **one** segment (e.g.: **two** data points) should be displayed after pressing the button'
+ ],
+ option: option1,
+ button: {
+ text: 'Click to trigger extraneous lines bug',
+ onClick: () => {
+ myChart.setOption(option2, true);
+ }
+ }
+ });
+ });
+
+ </script>
+
+
+ <script>
+
+ var chart;
+ var myChart;
+
+ const datasetSource1 = [['2019-04-14', 17], ['2019-04-16', 13], ['2019-04-17', 5]];
+ const datasetSource2 = [['2019-04-13', 0], ['2019-04-18', 23]];
+
+ require([
+ 'echarts'
+ ], function (echarts) {
+ var datasetSource1 = [[1554139666196,1554139778499,"17.0000000000000000"],[1554139778499,1554139890802,"17.0000000000000000"],[1554139890802,1554140003105,"17.0000000000000000"],[1554140003105,1554140115408,"17.0000000000000000"],[1554140115408,1554140227711,"17.0000000000000000"],[1554140227711,1554140340014,"17.0000000000000000"],[1554140340014,1554140452317,"17.0000000000000000"],[1554140452317,1554140564620,"17.0000000000000000"],[1554140564620,1554140676923,"17.000000000 [...]
+ var datasetSource2 = [[1554076772406,1554077221617,"0.00000000000000000000"],[1554077221617,1554077670828,"0.00000000000000000000"],[1554077670828,1554078120039,"0.00000000000000000000"],[1554078120039,1554078569250,"0.00000000000000000000"],[1554078569250,1554079018461,"0.00000000000000000000"],[1554079018461,1554079467672,"0.00000000000000000000"],[1554079467672,1554079916883,"0.00000000000000000000"],[1554079916883,1554080366094,"0.00000000000000000000"],[1554080366094,155 [...]
+
+ var filterMode = 'weakFilter'; // line-artifact
+ var filterMode = 'empty'; // OK
+ var filterMode = 'filter'; // line-artifact
+ var connectNulls = false;
+ var scale = true;
+
+ var option = {
+ dataZoom: [
+ {
+ show: true,
+ realtime: true,
+ filterMode: filterMode,
+ start: 0,
+ end: 100,
+ minValueSpan: 112303
+ }
+ ],
+ xAxis: {
+ type: "time",
+ min: 1554139674662,
+ max: 1554355295491,
+ },
+ dataset: [
+ {
+ source: datasetSource1,
+ sourceHeader: false
+ }
+ ],
+ yAxis: [
+ {
+ scale: scale,
+ type: "value"
+ }
+ ],
+ series: [
+ {
+ connectNulls: connectNulls,
+ name: "DSET",
+ type: "line",
+ yAxisIndex: 0,
+ showSymbol: false,
+ symbol: "rect",
+ datasetIndex: 0,
+ encode: {
+ x: [0],
+ y: 2
+ }
+ }
+ ]
+ };
+
+ var option2 = {
+ dataZoom: [
+ {
+ show: true,
+ realtime: true,
+ filterMode: filterMode,
+ start: 0,
+ end: 100,
+ minValueSpan: 449211
+ }
+ ],
+ xAxis: {
+ type: "time",
+ min: 1553695124932,
+ max: 1554557608248,
+ },
+ dataset: [
+ {
+ source: datasetSource2,
+ sourceHeader: false
+ }
+ ],
+ yAxis: [
+ {
+ scale: scale,
+ type: "value"
+ }
+ ],
+ series: [
+ {
+ connectNulls: connectNulls,
+ name: "DSET",
+ type: "line",
+ yAxisIndex: 0,
+ showSymbol: false,
+ symbol: "rect",
+ datasetIndex: 0,
+ encode: {
+ x: [0],
+ y: 2
+ }
+ }
+ ]
+ };
+
+ chart = myChart = testHelper.create(echarts, 'main1', {
+ title: [
+ 'Case from https://github.com/apache/echarts/issues/10228'
+ ],
+ option: option,
+ button: {
+ text: 'Click to trigger extraneous lines bug',
+ onClick: () => {
+ myChart.setOption(option2, true);
+ }
+ }
+ });
+ });
+
+ </script>
+
+</body>
+
+</html>
diff --git a/test/lines-extraneous.html b/test/lines-extraneous.html
deleted file mode 100644
index 75a857e..0000000
--- a/test/lines-extraneous.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE html>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-
-<html>
-
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <script src="lib/esl.js"></script>
- <script src="lib/config.js"></script>
- <script src="lib/facePrint.js"></script>
- <script src="lib/testHelper.js"></script>
- <link rel="stylesheet" href="lib/reset.css" />
-</head>
-
-<body>
- <style>
- .test-title {
- background: #146402;
- color: #fff;
- }
- </style>
-
-
- <div id="main0"></div>
-
- <script>
-
- /**
- * Related issues:
- * - https://github.com/apache/incubator-echarts/issues/10228
- * - https://github.com/apache/incubator-echarts/issues/11633
- * - https://github.com/apache/incubator-echarts/issues/12164
- * - https://github.com/apache/incubator-echarts/issues/12433
- */
-
- var chart;
- var myChart;
-
- const datasetSource1 = [['2019-04-14', 17], ['2019-04-16', 13], ['2019-04-17', 5]];
- const datasetSource2 = [['2019-04-13', 0], ['2019-04-18', 23]];
-
- require([
- 'echarts'
- ], function (echarts) {
- const option1 = {
- dataset: [
- {
- source: datasetSource1,
- sourceHeader: false
- }
- ],
- dataZoom: [
- { show: true }
- ],
- xAxis: {
- type: 'time',
- min: '2019-04-15',
- max: '2019-04-18',
- },
- yAxis: [
- {
- scale: true,
- type: 'value'
- }
- ],
- series: [
- {
- type: 'line',
- showSymbol: false,
- animation: false,
- }
- ]
- };
-
- const option2 = {
- dataset: [
- {
- source: datasetSource2,
- sourceHeader: false
- }
- ],
- dataZoom: [
- {
- show: true,
- start: 0,
- end: 100,
- }
- ],
- xAxis: {
- type: 'time',
- min: '2019-04-12',
- max: '2019-04-19',
- },
- yAxis: [
- {
- scale: true,
- type: 'value'
- }
- ],
- series: [
- {
- type: 'line',
- showSymbol: false,
- }
- ]
- };
-
- chart = myChart = testHelper.create(echarts, 'main0', {
- title: [
- 'Lines series should not show extraneous points when updating options',
- 'Only **one** segment (e.g.: **two** data points) should be displayed after pressing the button'
- ],
- option: option1,
- button: {
- text: 'Click to trigger extraneous lines bug',
- onClick: () => {
- myChart.setOption(option2, true);
- }
- }
- });
- });
-
- </script>
-
-</body>
-
-</html>
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 80a69e9..acc5386 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -102,6 +102,7 @@
"line-boldWhenHover": 1,
"line-crash": 1,
"line-endLabel": 1,
+ "line-extraneous": 2,
"map": 3,
"map-contour": 2,
"map-default": 1,
diff --git a/test/runTest/actions/line-extraneous.json b/test/runTest/actions/line-extraneous.json
new file mode 100644
index 0000000..455c58f
--- /dev/null
+++ b/test/runTest/actions/line-extraneous.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousedown","time":596,"x":28,"y":93},{"type":"mouseup","time":698,"x":28,"y":93},{"time":699,"delay":2000,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568042380534},{"name":"Action 2","ops":[{"type":"mousedown","time":736,"x":218,"y":184},{"type":"mouseup","time":827,"x":218,"y":184},{"time":828,"delay":400,"type":"screenshot-auto"}],"scrollY":416,"scrollX":0,"timestamp":1617082817083}]
\ No newline at end of file
diff --git a/test/runTest/actions/lines-extraneous.json b/test/runTest/actions/lines-extraneous.json
deleted file mode 100644
index 5f62fff..0000000
--- a/test/runTest/actions/lines-extraneous.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"name":"Action 1","ops":[{"type":"mousedown","time":596,"x":28,"y":93},{"type":"mouseup","time":698,"x":28,"y":93},{"time":699,"delay":2000,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1568042380534}]
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org