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 2021/04/21 17:21:38 UTC

[echarts] 01/02: fix(markPoint): symbolOffset & symbolKeepAspect doesn't work in MarkPoint.

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

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

commit 03fd5546367812d063c6550ddb098ff4482de0a7
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu Apr 22 00:55:25 2021 +0800

    fix(markPoint): symbolOffset & symbolKeepAspect doesn't work in MarkPoint.
    
    - current callback function logic seems inappropriate, data item should not support callback. refactor needed.
---
 src/component/marker/MarkPointView.ts | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/component/marker/MarkPointView.ts b/src/component/marker/MarkPointView.ts
index 82f1d69..b7cf0a2 100644
--- a/src/component/marker/MarkPointView.ts
+++ b/src/component/marker/MarkPointView.ts
@@ -120,8 +120,11 @@ class MarkPointView extends MarkerView {
             let symbol = itemModel.getShallow('symbol');
             let symbolSize = itemModel.getShallow('symbolSize');
             let symbolRotate = itemModel.getShallow('symbolRotate');
+            let symbolOffset = itemModel.getShallow('symbolOffset');
+            const symbolKeepAspect = itemModel.getShallow('symbolKeepAspect');
 
-            if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate)) {
+            // TODO: refactor needed: single data item should not support callback function
+            if (isFunction(symbol) || isFunction(symbolSize) || isFunction(symbolRotate) || isFunction(symbolOffset)) {
                 const rawIdx = mpModel.getRawValue(idx);
                 const dataParams = mpModel.getDataParams(idx);
                 if (isFunction(symbol)) {
@@ -134,6 +137,9 @@ class MarkPointView extends MarkerView {
                 if (isFunction(symbolRotate)) {
                     symbolRotate = symbolRotate(rawIdx, dataParams);
                 }
+                if (isFunction(symbolOffset)) {
+                    symbolOffset = symbolOffset(rawIdx, dataParams);
+                }
             }
 
             const style = itemModel.getModel('itemStyle').getItemStyle();
@@ -146,6 +152,8 @@ class MarkPointView extends MarkerView {
                 symbol: symbol,
                 symbolSize: symbolSize,
                 symbolRotate: symbolRotate,
+                symbolOffset: symbolOffset,
+                symbolKeepAspect: symbolKeepAspect,
                 style
             });
         });
@@ -209,4 +217,4 @@ function createList(
     return mpData;
 }
 
-export default MarkPointView;
\ No newline at end of file
+export default MarkPointView;

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