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/04/24 06:26:25 UTC

[incubator-echarts] branch label-enhancement updated (2b8da72 -> 9718d12)

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

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


    from 2b8da72  feat: improve label layouting. displayed by priority(default to be size of area).
     add a96d971  fix position of component view may not update bug.
     new 8c467f2  Merge branch 'next' into label-enhancement
     new 9718d12  fix(label): respect the original ignore value when handling overlap

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/echarts.ts           |  3 +++
 src/util/LabelManager.ts | 16 ++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)


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


[incubator-echarts] 02/02: fix(label): respect the original ignore value when handling overlap

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9718d12b5097aa9a28b262dd93af63b406becce1
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Apr 24 14:26:05 2020 +0800

    fix(label): respect the original ignore value when handling overlap
---
 src/util/LabelManager.ts | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/util/LabelManager.ts b/src/util/LabelManager.ts
index 0cdf2f3..a91daca 100644
--- a/src/util/LabelManager.ts
+++ b/src/util/LabelManager.ts
@@ -58,6 +58,8 @@ interface LabelLayoutDesc {
 }
 
 interface SavedLabelAttr {
+    ignore: boolean
+
     x: number
     y: number
     rotation: number
@@ -111,7 +113,12 @@ class LabelManager {
      * @param label
      * @param layoutOption
      */
-    addLabel(dataIndex: number, seriesIndex: number, label: ZRText, layoutOption: LabelLayoutDesc['layoutOption']) {
+    addLabel(
+        dataIndex: number,
+        seriesIndex: number,
+        label: ZRText,
+        layoutOption: LabelLayoutDesc['layoutOption']
+    ) {
         const labelStyle = label.style;
         const hostEl = label.__hostTarget;
         const textConfig = hostEl.textConfig || {};
@@ -148,6 +155,8 @@ class LabelManager {
             // Save default label attributes.
             // For restore if developers want get back to default value in callback.
             defaultAttr: {
+                ignore: label.ignore,
+
                 x: dummyTransformable.x,
                 y: dummyTransformable.y,
                 rotation: dummyTransformable.rotation,
@@ -290,13 +299,12 @@ class LabelManager {
             if (overlapped) {
                 // label.setStyle({ opacity: 0.1 });
                 // label.z = 0;
-                // Use invisible instead of ignore because ignored label won't be updated in the host.
-                label.attr('invisible', true);
+                label.hide();
             }
             else {
                 // TODO Restore z
                 // label.setStyle({ opacity: 1 });
-                label.attr('invisible', false);
+                label.attr('ignore', labelItem.defaultAttr.ignore);
 
                 displayedLabels.push({
                     label,


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


[incubator-echarts] 01/02: Merge branch 'next' into label-enhancement

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c467f2bcdadbe7e25f021a2fa2dd65854b9d9b3
Merge: 2b8da72 a96d971
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Apr 24 14:23:01 2020 +0800

    Merge branch 'next' into label-enhancement

 src/echarts.ts | 3 +++
 1 file changed, 3 insertions(+)

diff --cc src/echarts.ts
index ecaa352,d60e366..3121e9f
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@@ -1664,9 -1651,10 +1666,10 @@@ class ECharts extends Eventful 
                      renderTask.dirty();
                  }
  
 -                unfinished |= +renderTask.perform(scheduler.getPerformArgs(renderTask));
 +                unfinished = renderTask.perform(scheduler.getPerformArgs(renderTask)) || unfinished;
  
                  chartView.group.silent = !!seriesModel.get('silent');
+                 chartView.group.markRedraw();
  
                  updateZ(seriesModel, chartView);
  


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