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/06/13 19:21:07 UTC

[incubator-echarts] branch master updated (534aa14 -> 0ae9703)

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 534aa14  Merge branch 'master' of https://github.com/apache/incubator-echarts
     new e509060  tweak custom series style setting.
     new 0ae9703  remove auto dirty for setTextStyle and setLabelStyle.

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/custom.js | 24 +++++++++++++++++++-----
 src/util/graphic.js |  4 ++--
 2 files changed, 21 insertions(+), 7 deletions(-)

-- 
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


[incubator-echarts] 02/02: remove auto dirty for setTextStyle and setLabelStyle.

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 0ae97035f41b63020d5cf1e70f09b95857f5f21e
Author: sushuang <su...@gmail.com>
AuthorDate: Thu Jun 14 03:20:39 2018 +0800

    remove auto dirty for setTextStyle and setLabelStyle.
---
 src/util/graphic.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/graphic.js b/src/util/graphic.js
index bef342a..c1efd0a 100644
--- a/src/util/graphic.js
+++ b/src/util/graphic.js
@@ -582,7 +582,7 @@ export function setTextStyle(
 ) {
     setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis);
     specifiedTextStyle && zrUtil.extend(textStyle, specifiedTextStyle);
-    textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
+    // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
 
     return textStyle;
 }
@@ -607,7 +607,7 @@ export function setText(textStyle, labelModel, defaultColor) {
         opt.autoColor = defaultColor;
     }
     setTextStyleCommon(textStyle, labelModel, opt, isEmphasis);
-    textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
+    // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);
 }
 
 /**

-- 
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


[incubator-echarts] 01/02: tweak custom series style setting.

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 e509060ca13dfd1332a6f94c38d3944957ef321d
Author: sushuang <su...@gmail.com>
AuthorDate: Thu Jun 14 03:20:10 2018 +0800

    tweak custom series style setting.
---
 src/chart/custom.js | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/chart/custom.js b/src/chart/custom.js
index 191cc9b..148f529 100644
--- a/src/chart/custom.js
+++ b/src/chart/custom.js
@@ -218,7 +218,7 @@ function createEl(elOption) {
     return el;
 }
 
-function updateEl(el, dataIndex, elOption, animatableModel, data, isInit) {
+function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot) {
     var targetProps = {};
     var elOptionStyle = elOption.style || {};
 
@@ -272,7 +272,21 @@ function updateEl(el, dataIndex, elOption, animatableModel, data, isInit) {
     // z2 must not be null/undefined, otherwise sort error may occur.
     el.attr({z2: elOption.z2 || 0, silent: elOption.silent});
 
-    elOption.styleEmphasis !== false && graphicUtil.setHoverStyle(el, elOption.styleEmphasis);
+    // If `elOption.styleEmphasis` is `false`, remove hover style. The
+    // logic is ensured by `graphicUtil.setElementHoverStyle`.
+    var styleEmphasis = elOption.styleEmphasis;
+    var disableStyleEmphasis = styleEmphasis === false;
+    if (!(
+        // Try to escapse setting hover style for performance.
+        (el.__cusHasEmphStl && styleEmphasis == null)
+        || (!el.__cusHasEmphStl && disableStyleEmphasis)
+    )) {
+        // Should not use graphicUtil.setHoverStyle, since the styleEmphasis
+        // should not be share by group and its descendants.
+        graphicUtil.setElementHoverStyle(el, styleEmphasis);
+        el.__cusHasEmphStl = !disableStyleEmphasis;
+    }
+    isRoot && graphicUtil.setAsHoverStyleTrigger(el, !disableStyleEmphasis);
 }
 
 function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) {
@@ -496,13 +510,13 @@ function wrapEncodeDef(data) {
 }
 
 function createOrUpdate(el, dataIndex, elOption, animatableModel, group, data) {
-    el = doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data);
+    el = doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, true);
     el && data.setItemGraphicEl(dataIndex, el);
 
     return el;
 }
 
-function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data) {
+function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, isRoot) {
     elOption = elOption || {};
 
     var elOptionType = elOption.type;
@@ -528,7 +542,7 @@ function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data)
 
     var isInit = !el;
     !el && (el = createEl(elOption));
-    updateEl(el, dataIndex, elOption, animatableModel, data, isInit);
+    updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot);
 
     // If `renderItem` returns no children, follow the principle of
     // "merge", remain the children of the original elements

-- 
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