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/20 10:40:38 UTC

[incubator-echarts] branch next updated (7da95db -> f543734)

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

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


    from 7da95db  fix(animation): disable additive animation since it's still having issues.
     new 5e3ed2b  optimize default position of grid to avoid overlap with dataZoom
     new f543734  fix: optimize symbol animation

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/helper/Symbol.ts       | 28 +++++++++++++---------------
 src/chart/line/LineSeries.ts     |  2 +-
 src/chart/line/LineView.ts       |  7 ++++---
 src/coord/cartesian/Grid.ts      | 17 ++++++++++++++---
 src/coord/cartesian/GridModel.ts | 18 ++++++++++++++----
 src/model/globalDefault.ts       |  1 -
 6 files changed, 46 insertions(+), 27 deletions(-)


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


[incubator-echarts] 01/02: optimize default position of grid to avoid overlap with dataZoom

Posted by sh...@apache.org.
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

commit 5e3ed2b2beadce1365aaac83cf75f49d4a8c3672
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Oct 20 18:39:03 2020 +0800

    optimize default position of grid to avoid overlap with dataZoom
---
 src/chart/line/LineSeries.ts     |  2 +-
 src/coord/cartesian/Grid.ts      | 17 ++++++++++++++---
 src/coord/cartesian/GridModel.ts | 18 ++++++++++++++----
 src/model/globalDefault.ts       |  1 -
 4 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/src/chart/line/LineSeries.ts b/src/chart/line/LineSeries.ts
index 44ed861..8b29919 100644
--- a/src/chart/line/LineSeries.ts
+++ b/src/chart/line/LineSeries.ts
@@ -136,7 +136,7 @@ class LineSeriesModel extends SeriesModel<LineSeriesOption> {
 
     static defaultOption: LineSeriesOption = {
         zlevel: 0,
-        z: 2,
+        z: 3,
         coordinateSystem: 'cartesian2d',
         legendHoverLink: true,
 
diff --git a/src/coord/cartesian/Grid.ts b/src/coord/cartesian/Grid.ts
index 96801c8..a37bc07 100644
--- a/src/coord/cartesian/Grid.ts
+++ b/src/coord/cartesian/Grid.ts
@@ -38,7 +38,7 @@ import CoordinateSystemManager from '../../CoordinateSystem';
 import {ParsedModelFinder, SINGLE_REFERRING} from '../../util/model';
 
 // Depends on GridModel, AxisModel, which performs preprocess.
-import GridModel from './GridModel';
+import GridModel, {defaultGridLayoutWithoutLabel, defaultGridLayoutWithLabel} from './GridModel';
 import CartesianAxisModel from './AxisModel';
 import GlobalModel from '../../model/Global';
 import ExtensionAPI from '../../ExtensionAPI';
@@ -118,8 +118,19 @@ class Grid implements CoordinateSystemMaster {
      */
     resize(gridModel: GridModel, api: ExtensionAPI, ignoreContainLabel?: boolean): void {
 
+        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(
-            gridModel.getBoxLayoutParams(), {
+            boxLayoutParams, {
                 width: api.getWidth(),
                 height: api.getHeight()
             });
@@ -131,7 +142,7 @@ class Grid implements CoordinateSystemMaster {
         adjustAxes();
 
         // Minus label size
-        if (!ignoreContainLabel && gridModel.get('containLabel')) {
+        if (isContainLabel) {
             each(axesList, function (axis) {
                 if (!axis.model.get(['axisLabel', 'inside'])) {
                     const labelUnionRect = estimateLabelUnionRect(axis);
diff --git a/src/coord/cartesian/GridModel.ts b/src/coord/cartesian/GridModel.ts
index 7ca3682..e0d150d 100644
--- a/src/coord/cartesian/GridModel.ts
+++ b/src/coord/cartesian/GridModel.ts
@@ -37,6 +37,20 @@ 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';
@@ -51,10 +65,6 @@ class GridModel extends ComponentModel<GridOption> implements CoordinateSystemHo
         show: false,
         zlevel: 0,
         z: 0,
-        left: '10%',
-        top: 60,
-        right: '10%',
-        bottom: 60,
         // If grid size contain label
         containLabel: false,
         // width: {totalWidth} - left - right,
diff --git a/src/model/globalDefault.ts b/src/model/globalDefault.ts
index 6e67a12..289bcc7 100644
--- a/src/model/globalDefault.ts
+++ b/src/model/globalDefault.ts
@@ -76,7 +76,6 @@ export default {
     stateAnimation: {
         duration: 300,
         easing: 'cubicOut'
-        // additive: true
     },
 
     animation: 'auto',


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


[incubator-echarts] 02/02: fix: optimize symbol animation

Posted by sh...@apache.org.
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

commit f543734d3f979812b4b8f00c73328c2ef5541742
Author: pissang <bm...@gmail.com>
AuthorDate: Tue Oct 20 18:39:55 2020 +0800

    fix: optimize symbol animation
---
 src/chart/helper/Symbol.ts | 28 +++++++++++++---------------
 src/chart/line/LineView.ts |  7 ++++---
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts
index 5217780..7acb533 100644
--- a/src/chart/helper/Symbol.ts
+++ b/src/chart/helper/Symbol.ts
@@ -177,20 +177,19 @@ class Symbol extends graphic.Group {
         if (isInit) {
             const symbolPath = this.childAt(0) as ECSymbol;
 
-            const target: PathProps = {
-                scaleX: this._sizeX,
-                scaleY: this._sizeY,
-                style: {
-                    // Always fadeIn. Because it has fadeOut animation when symbol is removed..
-                    opacity: symbolPath.style.opacity
-                }
-            };
-
-            symbolPath.scaleX = symbolPath.scaleY = 0;
-            symbolPath.style.opacity = 0;
-
-            disableAnimation ? symbolPath.attr(target)
-                : graphic.initProps(symbolPath, target, seriesModel, idx);
+            if (!disableAnimation) {
+                const target: PathProps = {
+                    scaleX: this._sizeX,
+                    scaleY: this._sizeY,
+                    style: {
+                        // Always fadeIn. Because it has fadeOut animation when symbol is removed..
+                        opacity: symbolPath.style.opacity
+                    }
+                };
+                symbolPath.scaleX = symbolPath.scaleY = 0;
+                symbolPath.style.opacity = 0;
+                graphic.initProps(symbolPath, target, seriesModel, idx);
+            }
         }
 
         this._seriesModel = seriesModel;
@@ -335,7 +334,6 @@ class Symbol extends graphic.Group {
             emphasisState.scaleX = this._sizeX * scaleRatio;
             emphasisState.scaleY = this._sizeY * scaleRatio;
         }
-
         this.setSymbolScale(1);
 
         enableHoverEmphasis(this, focus, blurScope);
diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts
index 4a8a48a..654783e 100644
--- a/src/chart/line/LineView.ts
+++ b/src/chart/line/LineView.ts
@@ -1008,7 +1008,10 @@ class LineView extends ChartView {
                 const delay = typeof seriesDalay === 'function' ? seriesDalay(idx)
                     : (seriesDuration * ratio) + seriesDalayValue;
 
-                el.animateFrom({
+                const symbolPath = el.getSymbolPath();
+                const text = symbolPath.getTextContent();
+
+                symbolPath.animateFrom({
                     scaleX: 0,
                     scaleY: 0
                 }, {
@@ -1016,8 +1019,6 @@ class LineView extends ChartView {
                     delay: delay
                 });
 
-                const symbolPath = el.getSymbolPath();
-                const text = symbolPath.getTextContent();
                 if (text) {
                     text.animateFrom({
                         style: {


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