You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/07/11 08:36:40 UTC

[echarts] branch fix/visualMap-label-indicator created (now 71bdec63c)

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

wangzx pushed a change to branch fix/visualMap-label-indicator
in repository https://gitbox.apache.org/repos/asf/echarts.git


      at 71bdec63c chore: fix some typos

This branch includes the following new commits:

     new 131774302 fix(visualMap): fix the indicator doesn't show when hovering on map label.
     new 71bdec63c chore: fix some typos

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.



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


[echarts] 01/02: fix(visualMap): fix the indicator doesn't show when hovering on map label.

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

wangzx pushed a commit to branch fix/visualMap-label-indicator
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 13177430235f99ca566741b35f06614f4332eec2
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Mon Jul 11 16:32:44 2022 +0800

    fix(visualMap): fix the indicator doesn't show when hovering on map label.
---
 src/component/visualMap/ContinuousView.ts | 20 ++++++++++++++------
 test/runTest/actions/__meta__.json        |  2 +-
 test/runTest/actions/geo-map.json         |  2 +-
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts
index ac31cd094..68ad34317 100644
--- a/src/component/visualMap/ContinuousView.ts
+++ b/src/component/visualMap/ContinuousView.ts
@@ -32,13 +32,14 @@ import GlobalModel from '../../model/Global';
 import ExtensionAPI from '../../core/ExtensionAPI';
 import Element, { ElementEvent } from 'zrender/src/Element';
 import { TextVerticalAlign, TextAlign } from 'zrender/src/core/types';
-import { ColorString, Payload } from '../../util/types';
+import { ColorString, ECEventData, Payload } from '../../util/types';
 import { parsePercent } from 'zrender/src/contain/text';
 import { setAsHighDownDispatcher } from '../../util/states';
 import { createSymbol } from '../../util/symbol';
 import ZRImage from 'zrender/src/graphic/Image';
 import { getECData } from '../../util/innerStore';
 import { createTextStyle } from '../../label/labelStyle';
+import { findEventDispatcher } from '../../util/event';
 
 const linearMap = numberUtil.linearMap;
 const each = zrUtil.each;
@@ -816,16 +817,23 @@ class ContinuousView extends VisualMapView {
     }
 
     private _hoverLinkFromSeriesMouseOver(e: ElementEvent) {
-        const el = e.target;
-        const visualMapModel = this.visualMapModel;
+        let ecData: ECEventData;
+
+        findEventDispatcher(e.target, target => {
+            const currECData = getECData(target);
+            if (currECData.dataIndex != null) {
+                ecData = currECData;
+                return true;
+            }
+        }, true);
 
-        if (!el || getECData(el).dataIndex == null) {
+        if (!ecData) {
             return;
         }
-        const ecData = getECData(el);
 
         const dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);
 
+        const visualMapModel = this.visualMapModel;
         if (!visualMapModel.isTargetSeries(dataModel)) {
             return;
         }
@@ -947,4 +955,4 @@ function getCursor(orient: Orient) {
     return orient === 'vertical' ? 'ns-resize' : 'ew-resize';
 }
 
-export default ContinuousView;
\ No newline at end of file
+export default ContinuousView;
diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json
index baadde980..ae9e2a699 100644
--- a/test/runTest/actions/__meta__.json
+++ b/test/runTest/actions/__meta__.json
@@ -88,7 +88,7 @@
   "emphasis-inherit": 1,
   "funnel": 2,
   "gauge-simple": 2,
-  "geo-map": 3,
+  "geo-map": 4,
   "geo-map-features": 3,
   "geo-svg": 8,
   "geo-svg-demo": 6,
diff --git a/test/runTest/actions/geo-map.json b/test/runTest/actions/geo-map.json
index ffbe5bcc1..b9f156653 100644
--- a/test/runTest/actions/geo-map.json
+++ b/test/runTest/actions/geo-map.json
@@ -1 +1 @@
-[{"name":"Action 1","ops":[{"type":"mousedown","time":750,"x":67,"y":8},{"type":"mouseup","time":835,"x":67,"y":8},{"time":836,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1086,"x":67,"y":8},{"type":"mousemove","time":1291,"x":65,"y":29},{"type":"mousemove","time":1491,"x":65,"y":30},{"type":"mousedown","time":1667,"x":65,"y":30},{"type":"mouseup","time":1785,"x":65,"y":30},{"time":1786,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2142,"x":65,"y":3 [...]
\ No newline at end of file
+[{"name":"Action 1","ops":[{"type":"mousemove","time":461,"x":229,"y":419},{"type":"mousemove","time":735,"x":246,"y":350},{"type":"mousemove","time":1019,"x":249,"y":366},{"type":"screenshot","time":2182}],"scrollY":0,"scrollX":0,"timestamp":1657527803250},{"name":"Action 2","ops":[{"type":"mousedown","time":750,"x":67,"y":8},{"type":"mouseup","time":835,"x":67,"y":8},{"time":836,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":1086,"x":67,"y":8},{"type":"mousemove","tim [...]
\ 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


[echarts] 02/02: chore: fix some typos

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

wangzx pushed a commit to branch fix/visualMap-label-indicator
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 71bdec63c10f8a6fa2253505b3957a24b39447aa
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Mon Jul 11 16:35:11 2022 +0800

    chore: fix some typos
---
 src/component/helper/MapDraw.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/component/helper/MapDraw.ts b/src/component/helper/MapDraw.ts
index 591561941..529601454 100644
--- a/src/component/helper/MapDraw.ts
+++ b/src/component/helper/MapDraw.ts
@@ -820,7 +820,7 @@ function resetEventTriggerForRegion(
     dataIdx: number
 ): void {
     // setItemGraphicEl, setHoverStyle after all polygons and labels
-    // are added to the rigionGroup
+    // are added to the regionGroup
     if (viewBuildCtx.data) {
         // FIXME: when series-map use a SVG map, and there are duplicated name specified
         // on different SVG elements, after `data.setItemGraphicEl(...)`:
@@ -832,7 +832,7 @@ function resetEventTriggerForRegion(
         viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);
     }
     // series-map will not trigger "geoselectchange" no matter it is
-    // based on a declared geo component. Becuause series-map will
+    // based on a declared geo component. Because series-map will
     // trigger "selectchange". If it trigger both the two events,
     // If users call `chart.dispatchAction({type: 'toggleSelect'})`,
     // it not easy to also fire event "geoselectchanged".


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