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 2020/04/02 13:32:54 UTC

[incubator-echarts] branch master updated (fb72a4c -> 5817659)

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 fb72a4c  fix: axis min/max function return null: The original PR is:  #12215 cf5812f6aad64e433c0de89c62bd0d84b7f3f0cf Fix from that: (1) The min/max function call should not be called twice (necessary and probably wrong input params). (2) `fixMin` `fixMax` should cover function return. (3) Add more test cases.
     new 8e99715  fix: bar background border radius. The original PR is #12331 fbe73aec2b265c99e78aebcf575b23bc339b60c8 This commit fixes: also update `r` when "update" rather than only in "add". Add more test cases.
     new 5817659  fix: remove peerDep, which is not used correctly.

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                 | 13 +++++++++----
 test/bar-background.html                 | 18 +++++++++++++++++-
 test/runTest/actions/__meta__.json       |  1 +
 test/runTest/actions/bar-background.json |  1 +
 4 files changed, 28 insertions(+), 5 deletions(-)
 create mode 100644 test/runTest/actions/bar-background.json


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[incubator-echarts] 02/02: fix: remove peerDep, which is not used correctly.

Posted by su...@apache.org.
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 58176594bcfccc49df8d8fa455073707baf91106
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Apr 2 21:27:28 2020 +0800

    fix: remove peerDep, which is not used correctly.
---
 package.json | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/package.json b/package.json
index a6335d4..8111384 100644
--- a/package.json
+++ b/package.json
@@ -61,8 +61,5 @@
     "serve-handler": "6.1.1",
     "slugify": "1.3.4",
     "socket.io": "2.2.0"
-  },
-  "peerDependencies": {
-    "puppeteer": "^2.1.1"
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[incubator-echarts] 01/02: fix: bar background border radius. The original PR is #12331 fbe73aec2b265c99e78aebcf575b23bc339b60c8 This commit fixes: also update `r` when "update" rather than only in "add". Add more test cases.

Posted by su...@apache.org.
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 8e997155caabfbc5e1aa44f8488dba9af33c0c9b
Author: 100pah <su...@gmail.com>
AuthorDate: Thu Apr 2 20:19:44 2020 +0800

    fix: bar background border radius.
    The original PR is #12331
    fbe73aec2b265c99e78aebcf575b23bc339b60c8
    This commit fixes: also update `r` when "update" rather than only in "add".
    Add more test cases.
---
 package.json                             |  3 +++
 src/chart/bar/BarView.js                 | 13 +++++++++----
 test/bar-background.html                 | 18 +++++++++++++++++-
 test/runTest/actions/__meta__.json       |  1 +
 test/runTest/actions/bar-background.json |  1 +
 5 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/package.json b/package.json
index 8111384..a6335d4 100644
--- a/package.json
+++ b/package.json
@@ -61,5 +61,8 @@
     "serve-handler": "6.1.1",
     "slugify": "1.3.4",
     "socket.io": "2.2.0"
+  },
+  "peerDependencies": {
+    "puppeteer": "^2.1.1"
   }
 }
diff --git a/src/chart/bar/BarView.js b/src/chart/bar/BarView.js
index defaa90..747f4ad 100644
--- a/src/chart/bar/BarView.js
+++ b/src/chart/bar/BarView.js
@@ -130,6 +130,7 @@ export default echarts.extendChartView({
 
         var drawBackground = seriesModel.get('showBackground', true);
         var backgroundModel = seriesModel.getModel('backgroundStyle');
+        var barBorderRadius = backgroundModel.get('barBorderRadius') || 0;
 
         var bgEls = [];
         var oldBgEls = this._backgroundEls || [];
@@ -140,10 +141,10 @@ export default echarts.extendChartView({
                 var layout = getLayout[coord.type](data, dataIndex, itemModel);
 
                 if (drawBackground) {
-                    var bgLayout = getLayout[coord.type](data, dataIndex, backgroundModel);
+                    var bgLayout = getLayout[coord.type](data, dataIndex);
                     var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
                     bgEl.useStyle(backgroundModel.getBarItemStyle());
-                    bgEl.setShape('r', backgroundModel.get('barBorderRadius'));
+                    bgEl.setShape('r', barBorderRadius);
                     bgEls[dataIndex] = bgEl;
                 }
 
@@ -180,9 +181,11 @@ export default echarts.extendChartView({
                 if (drawBackground) {
                     var bgEl = oldBgEls[oldIndex];
                     bgEl.useStyle(backgroundModel.getBarItemStyle());
+                    bgEl.setShape('r', barBorderRadius);
                     bgEls[newIndex] = bgEl;
 
-                    var shape = createBackgroundShape(isHorizontalOrRadial, layout, coord);
+                    var bgLayout = getLayout[coord.type](data, newIndex);
+                    var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
                     graphic.updateProps(bgEl, { shape: shape }, animationModel, newIndex);
                 }
 
@@ -432,9 +435,11 @@ function removeSector(dataIndex, animationModel, el) {
 }
 
 var getLayout = {
+    // itemModel is only used to get borderWidth, which is not needed
+    // when calculating bar background layout.
     cartesian2d: function (data, dataIndex, itemModel) {
         var layout = data.getItemLayout(dataIndex);
-        var fixedLineWidth = getLineWidth(itemModel, layout);
+        var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout) : 0;
 
         // fix layout with lineWidth
         var signX = layout.width > 0 ? 1 : -1;
diff --git a/test/bar-background.html b/test/bar-background.html
index d685566..1ca94f3 100644
--- a/test/bar-background.html
+++ b/test/bar-background.html
@@ -533,6 +533,10 @@ under the License.
                     series: [{
                         data: [110, 120, 150, 250, 350, 400, 500, 600],
                         type: 'bar',
+                        itemStyle: {
+                            barBorderWidth: 20,
+                            barBorderColor: 'rgba(50,50,50,0.3)'
+                        },
                         showBackground: true,
                         backgroundStyle: {
                             color: 'green',
@@ -545,7 +549,19 @@ under the License.
                     option: option,
                     title: [
                         'background barBorderRadius'
-                    ]
+                    ],
+                    buttons: [{
+                        text: 'update barBorderRadius to [30, 40, 0, 60]',
+                        onclick: function () {
+                            chart.setOption({
+                                series: {
+                                    backgroundStyle: {
+                                        barBorderRadius: [30, 40, 0, 60]
+                                    }
+                                }
+                            });
+                        }
+                    }]
                 });
             });
         </script>
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index 1669540..4915a31 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -17,6 +17,7 @@
   "axis-style": 2,
   "axisPosition": 2,
   "bar": 2,
+  "bar-background": 3,
   "bar-label-rotation": 2,
   "bar-large": 2,
   "bar-overflow-time-plot": 3,
diff --git a/test/runTest/actions/bar-background.json b/test/runTest/actions/bar-background.json
new file mode 100644
index 0000000..38595b6
--- /dev/null
+++ b/test/runTest/actions/bar-background.json
@@ -0,0 +1 @@
+[{"name":"Action 1","ops":[{"type":"mousemove","time":560,"x":793,"y":238},{"type":"mousemove","time":761,"x":444,"y":258},{"type":"mousewheel","time":1526,"x":444,"y":258,"deltaY":1},{"type":"mousewheel","time":1592,"x":444,"y":258,"deltaY":24},{"type":"mousewheel","time":1626,"x":444,"y":258,"deltaY":10},{"type":"mousewheel","time":1671,"x":444,"y":258,"deltaY":11},{"type":"mousewheel","time":1691,"x":444,"y":258,"deltaY":8},{"type":"mousewheel","time":1713,"x":444,"y":258,"deltaY":3}, [...]
\ 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