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 2020/10/21 05:23:55 UTC

[incubator-echarts] branch next updated: fix(grid): revert optimize of grid layout adjust based on containLabel

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/next by this push:
     new bee677e  fix(grid): revert optimize of grid layout adjust based on containLabel
bee677e is described below

commit bee677e1b1ff4dcb7a0971e1c0be0b838c0139ea
Author: pissang <bm...@gmail.com>
AuthorDate: Wed Oct 21 13:23:34 2020 +0800

    fix(grid): revert optimize of grid layout adjust based on containLabel
---
 src/coord/cartesian/Grid.ts      |  8 --------
 src/coord/cartesian/GridModel.ts | 18 ++++--------------
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/src/coord/cartesian/Grid.ts b/src/coord/cartesian/Grid.ts
index a37bc07..5da228c 100644
--- a/src/coord/cartesian/Grid.ts
+++ b/src/coord/cartesian/Grid.ts
@@ -121,14 +121,6 @@ class Grid implements CoordinateSystemMaster {
         const boxLayoutParams = gridModel.getBoxLayoutParams();
         const isContainLabel = !ignoreContainLabel && gridModel.get('containLabel');
 
-        each(defaultGridLayoutWithoutLabel, function (val, key) {
-            if (boxLayoutParams[key] == null || boxLayoutParams[key] === 'auto') {
-                boxLayoutParams[key] = isContainLabel
-                    ? defaultGridLayoutWithLabel[key]
-                    : defaultGridLayoutWithoutLabel[key];
-            }
-        });
-
         const gridRect = getLayoutRect(
             boxLayoutParams, {
                 width: api.getWidth(),
diff --git a/src/coord/cartesian/GridModel.ts b/src/coord/cartesian/GridModel.ts
index e0d150d..a3ed512 100644
--- a/src/coord/cartesian/GridModel.ts
+++ b/src/coord/cartesian/GridModel.ts
@@ -37,20 +37,6 @@ export interface GridOption extends ComponentOption, BoxLayoutOptionMixin, Shado
     tooltip?: any; // FIXME:TS add this tooltip type
 }
 
-export const defaultGridLayoutWithoutLabel = {
-    left: '10%',
-    top: 60,
-    right: '10%',
-    bottom: 70
-} as const;
-
-export const defaultGridLayoutWithLabel = {
-    left: '5%',
-    top: 60,
-    right: '5%',
-    bottom: 55
-} as const;
-
 class GridModel extends ComponentModel<GridOption> implements CoordinateSystemHostModel {
 
     static type = 'grid';
@@ -65,6 +51,10 @@ class GridModel extends ComponentModel<GridOption> implements CoordinateSystemHo
         show: false,
         zlevel: 0,
         z: 0,
+        left: '10%',
+        top: 60,
+        right: '10%',
+        bottom: 70,
         // If grid size contain label
         containLabel: false,
         // width: {totalWidth} - left - right,


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