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


The following commit(s) were added to refs/heads/next by this push:
     new 898c6b4  refact: add mapDimensionsAll. Model use resolveParentPath 
instead of customizeGetParent for simplicity and performance.
898c6b4 is described below

commit 898c6b4f8f6ca11d821f926c267a186310f92595
Author: pissang <[email protected]>
AuthorDate: Wed Apr 15 13:26:32 2020 +0800

    refact: add mapDimensionsAll. Model use resolveParentPath instead of 
customizeGetParent for simplicity and performance.
---
 .eslintignore                              |  3 +-
 src/chart/boxplot/boxplotLayout.ts         |  2 +-
 src/chart/candlestick/candlestickLayout.ts |  2 +-
 src/chart/graph/GraphSeries.ts             | 46 +++++++++----------
 src/chart/graph/simpleLayout.ts            |  2 +-
 src/chart/helper/labelHelper.ts            |  2 +-
 src/chart/sankey/SankeySeries.ts           | 36 ++++++++-------
 src/chart/sankey/SankeyView.ts             |  2 +-
 src/component/axisPointer/axisTrigger.ts   |  2 +-
 src/component/dataZoom/AxisProxy.ts        |  4 +-
 src/component/tooltip/TooltipView.ts       | 10 +++++
 src/coord/cartesian/Grid.ts                |  2 +-
 src/coord/polar/polarCreator.ts            |  4 +-
 src/coord/single/Single.ts                 |  2 +-
 src/data/List.ts                           | 10 ++---
 src/model/Model.ts                         | 72 ++++++++++++++----------------
 src/model/Series.ts                        |  8 ++--
 src/model/mixin/dataFormat.ts              | 15 ++-----
 src/util/graphic.ts                        |  4 +-
 src/visual/style.ts                        |  6 ++-
 20 files changed, 118 insertions(+), 116 deletions(-)

diff --git a/.eslintignore b/.eslintignore
index 246d599..6274b8a 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,2 +1,3 @@
 /dist
-/node_modules
\ No newline at end of file
+/node_modules
+/build
\ No newline at end of file
diff --git a/src/chart/boxplot/boxplotLayout.ts 
b/src/chart/boxplot/boxplotLayout.ts
index 69c6465..a7a3997 100644
--- a/src/chart/boxplot/boxplotLayout.ts
+++ b/src/chart/boxplot/boxplotLayout.ts
@@ -149,7 +149,7 @@ function layoutSingleSeries(seriesModel: 
BoxplotSeriesModel, offset: number, box
     const vDimIdx = 1 - cDimIdx;
     const coordDims = ['x', 'y'];
     const cDim = data.mapDimension(coordDims[cDimIdx]);
-    const vDims = data.mapDimension(coordDims[vDimIdx], true);
+    const vDims = data.mapDimensionsAll(coordDims[vDimIdx]);
 
     if (cDim == null || vDims.length < 5) {
         return;
diff --git a/src/chart/candlestick/candlestickLayout.ts 
b/src/chart/candlestick/candlestickLayout.ts
index e64f7ec..615c684 100644
--- a/src/chart/candlestick/candlestickLayout.ts
+++ b/src/chart/candlestick/candlestickLayout.ts
@@ -57,7 +57,7 @@ const candlestickLayout: StageHandler = {
         const vDimIdx = 1;
         const coordDims = ['x', 'y'];
         const cDim = data.mapDimension(coordDims[cDimIdx]);
-        const vDims = data.mapDimension(coordDims[vDimIdx], true);
+        const vDims = data.mapDimensionsAll(coordDims[vDimIdx]);
         const openDim = vDims[0];
         const closeDim = vDims[1];
         const lowestDim = vDims[2];
diff --git a/src/chart/graph/GraphSeries.ts b/src/chart/graph/GraphSeries.ts
index 10fd53a..6ec4c2f 100644
--- a/src/chart/graph/GraphSeries.ts
+++ b/src/chart/graph/GraphSeries.ts
@@ -279,32 +279,32 @@ class GraphSeriesModel extends 
SeriesModel<GraphSeriesOption> {
                 return model;
             });
 
-            const edgeLabelModel = self.getModel('edgeLabel');
-            // For option `edgeLabel` can be found by label.xxx.xxx on item 
mode.
-            const fakeSeriesModel = new Model(
-                {label: edgeLabelModel.option},
-                edgeLabelModel.parentModel,
-                ecModel
-            );
-            const emphasisEdgeLabelModel = self.getModel(['emphasis', 
'edgeLabel']);
-            const emphasisFakeSeriesModel = new Model(
-                {emphasis: {label: emphasisEdgeLabelModel.option}},
-                emphasisEdgeLabelModel.parentModel,
-                ecModel
-            );
-
-            edgeData.wrapMethod('getItemModel', function (model) {
-                model.customizeGetParent(edgeGetParent);
+            // TODO Inherit resolveParentPath by default in Model#getModel?
+            const oldGetModel = Model.prototype.getModel;
+            function newGetModel(this: Model, path: any, parentModel?: Model) {
+                const model = oldGetModel.call(this, path, parentModel);
+                model.resolveParentPath = resolveParentPath;
+                return model;
+            }
+
+            edgeData.wrapMethod('getItemModel', function (model: Model) {
+                model.resolveParentPath = resolveParentPath;
+                model.getModel = newGetModel;
                 return model;
             });
 
-            function edgeGetParent(this: Model, path: string | string[]) {
-                const pathArr = this.parsePath(path);
-                return (pathArr && pathArr[0] === 'label')
-                    ? fakeSeriesModel
-                    : (pathArr && pathArr[0] === 'emphasis' && pathArr[1] === 
'label')
-                    ? emphasisFakeSeriesModel
-                    : this.parentModel;
+            function resolveParentPath(this: Model, pathArr: readonly 
string[]): string[] {
+                if (pathArr && (pathArr[0] === 'label' || pathArr[1] === 
'label')) {
+                    const newPathArr = pathArr.slice();
+                    if (pathArr[0] === 'label') {
+                        newPathArr[0] = 'edgeLabel';
+                    }
+                    else if (pathArr[1] === 'label') {
+                        newPathArr[1] = 'edgeLabel';
+                    }
+                    return newPathArr;
+                }
+                return pathArr as string[];
             }
         }
     }
diff --git a/src/chart/graph/simpleLayout.ts b/src/chart/graph/simpleLayout.ts
index d947f96..945b138 100644
--- a/src/chart/graph/simpleLayout.ts
+++ b/src/chart/graph/simpleLayout.ts
@@ -32,7 +32,7 @@ export default function (ecModel: GlobalModel, api: 
ExtensionAPI) {
 
             let dimensions: string[] = [];
             each(coordSys.dimensions, function (coordDim) {
-                dimensions = dimensions.concat(data.mapDimension(coordDim, 
true));
+                dimensions = 
dimensions.concat(data.mapDimensionsAll(coordDim));
             });
 
             for (let dataIndex = 0; dataIndex < data.count(); dataIndex++) {
diff --git a/src/chart/helper/labelHelper.ts b/src/chart/helper/labelHelper.ts
index 595780e..25a0960 100644
--- a/src/chart/helper/labelHelper.ts
+++ b/src/chart/helper/labelHelper.ts
@@ -25,7 +25,7 @@ import List from '../../data/List';
  * @return label string. Not null/undefined
  */
 export function getDefaultLabel(data: List, dataIndex: number): string {
-    const labelDims = data.mapDimension('defaultedLabel', true);
+    const labelDims = data.mapDimensionsAll('defaultedLabel');
     const len = labelDims.length;
 
     // Simple optimization (in lots of cases, label dims length is 1)
diff --git a/src/chart/sankey/SankeySeries.ts b/src/chart/sankey/SankeySeries.ts
index 21ea491..7579be6 100644
--- a/src/chart/sankey/SankeySeries.ts
+++ b/src/chart/sankey/SankeySeries.ts
@@ -177,24 +177,30 @@ class SankeySeriesModel extends 
SeriesModel<SankeySeriesOption> {
             return graph.data;
         }
         function beforeLink(nodeData: List, edgeData: List) {
-            nodeData.wrapMethod('getItemModel', function (model, idx) {
-                model.customizeGetParent(function (this: Model, path: string | 
string[]) {
-                    const parentModel = this.parentModel as SankeySeriesModel;
-                    const nodeDepth = 
parentModel.getData().getItemLayout(idx).depth;
-                    const levelModel = parentModel.levelModels[nodeDepth];
-                    return levelModel || this.parentModel;
-                });
+            nodeData.wrapMethod('getItemModel', function (model: Model, idx: 
number) {
+                const seriesModel = model.parentModel as SankeySeriesModel;
+                const layout = seriesModel.getData().getItemLayout(idx);
+                if (layout) {
+                    const nodeDepth = layout.depth;
+                    const levelModel = seriesModel.levelModels[nodeDepth];
+                    if (levelModel) {
+                        model.parentModel = levelModel;
+                    }
+                }
                 return model;
             });
 
-            edgeData.wrapMethod('getItemModel', function (model, idx) {
-                model.customizeGetParent(function (this: Model, path: string | 
string[]) {
-                    const parentModel = this.parentModel as SankeySeriesModel;
-                    const edge = parentModel.getGraph().getEdgeByIndex(idx);
-                    const depth = edge.node1.getLayout().depth;
-                    const levelModel = parentModel.levelModels[depth];
-                    return levelModel || this.parentModel;
-                });
+            edgeData.wrapMethod('getItemModel', function (model: Model, idx: 
number) {
+                const seriesModel = model.parentModel as SankeySeriesModel;
+                const edge = seriesModel.getGraph().getEdgeByIndex(idx);
+                const layout = edge.node1.getLayout();
+                if (layout) {
+                    const depth = layout.depth;
+                    const levelModel = seriesModel.levelModels[depth];
+                    if (levelModel) {
+                        model.parentModel = levelModel;
+                    }
+                }
                 return model;
             });
         }
diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts
index 1d48089..6c03f7b 100644
--- a/src/chart/sankey/SankeyView.ts
+++ b/src/chart/sankey/SankeyView.ts
@@ -443,7 +443,6 @@ class SankeyView extends ChartView {
         const data = seriesModel.getData();
         const graph = data.graph;
         const dataIndex = payload.dataIndex;
-        const itemModel = data.getItemModel<SankeyNodeItemOption>(dataIndex);
         const edgeDataIndex = payload.edgeDataIndex;
 
         if (dataIndex == null && edgeDataIndex == null) {
@@ -460,6 +459,7 @@ class SankeyView extends ChartView {
         });
 
         if (node) {
+            const itemModel = 
data.getItemModel<SankeyNodeItemOption>(dataIndex);
             fadeInItem(node, hoverNodeOpacityPath);
             const focusNodeAdj = itemModel.get('focusNodeAdjacency');
             if (focusNodeAdj === 'outEdges') {
diff --git a/src/component/axisPointer/axisTrigger.ts 
b/src/component/axisPointer/axisTrigger.ts
index e634ab7..4018c9f 100644
--- a/src/component/axisPointer/axisTrigger.ts
+++ b/src/component/axisPointer/axisTrigger.ts
@@ -263,7 +263,7 @@ function buildPayloadsBySeries(value: AxisValue, axisInfo: 
CollectedAxisInfo) {
     let minDiff = -1;
 
     each(axisInfo.seriesModels, function (series, idx) {
-        const dataDim = series.getData().mapDimension(dim, true);
+        const dataDim = series.getData().mapDimensionsAll(dim);
         let seriesNestestValue;
         let dataIndices;
 
diff --git a/src/component/dataZoom/AxisProxy.ts 
b/src/component/dataZoom/AxisProxy.ts
index bcf04cf..8e9a7aa 100644
--- a/src/component/dataZoom/AxisProxy.ts
+++ b/src/component/dataZoom/AxisProxy.ts
@@ -337,7 +337,7 @@ class AxisProxy {
 
         each(seriesModels, function (seriesModel) {
             let seriesData = seriesModel.getData();
-            const dataDims = seriesData.mapDimension(axisDim, true);
+            const dataDims = seriesData.mapDimensionsAll(axisDim);
 
             if (!dataDims.length) {
                 return;
@@ -451,7 +451,7 @@ function calculateDataExtent(axisProxy: AxisProxy, axisDim: 
string, seriesModels
     each(seriesModels, function (seriesModel) {
         const seriesData = seriesModel.getData();
         if (seriesData) {
-            each(seriesData.mapDimension(axisDim, true), function (dim) {
+            each(seriesData.mapDimensionsAll(axisDim), function (dim) {
                 const seriesExtent = seriesData.getApproximateExtent(dim);
                 seriesExtent[0] < dataExtent[0] && (dataExtent[0] = 
seriesExtent[0]);
                 seriesExtent[1] > dataExtent[1] && (dataExtent[1] = 
seriesExtent[1]);
diff --git a/src/component/tooltip/TooltipView.ts 
b/src/component/tooltip/TooltipView.ts
index 3ddcc77..52187e4 100644
--- a/src/component/tooltip/TooltipView.ts
+++ b/src/component/tooltip/TooltipView.ts
@@ -131,6 +131,7 @@ type TooltipDataParams = CallbackDataParams & {
     // TODO: TYPE Value type
     axisValue?: string | number
     axisValueLabel?: string
+    marker?: formatUtil.TooltipMarker
 };
 class TooltipView extends ComponentView {
     static type = 'tooltip' as const;
@@ -535,6 +536,10 @@ class TooltipView extends ComponentView {
                     dataParams.axisId = item.axisId;
                     dataParams.axisValue = 
axisHelper.getAxisRawValue(axisModel.axis, axisValue);
                     dataParams.axisValueLabel = valueLabel;
+                    dataParams.marker = formatUtil.getTooltipMarker({
+                        color: dataParams.color as ColorString,
+                        renderMode
+                    });
 
                     if (dataParams) {
                         singleParamsList.push(dataParams);
@@ -631,6 +636,11 @@ class TooltipView extends ComponentView {
         }
 
         const params = dataModel.getDataParams(dataIndex, dataType);
+        params.marker = formatUtil.getTooltipMarker({
+            color: params.color as ColorString,
+            renderMode: this._renderMode
+        });
+
         const seriesTooltip = dataModel.formatTooltip(dataIndex, false, 
dataType, this._renderMode);
         let defaultHtml: string;
         let markers: Dictionary<ColorString>;
diff --git a/src/coord/cartesian/Grid.ts b/src/coord/cartesian/Grid.ts
index b7d7dce..0b0f2dd 100644
--- a/src/coord/cartesian/Grid.ts
+++ b/src/coord/cartesian/Grid.ts
@@ -438,7 +438,7 @@ class Grid implements CoordinateSystemMaster {
         }, this);
 
         function unionExtent(data: List, axis: Axis2D): void {
-            each(data.mapDimension(axis.dim, true), function (dim) {
+            each(data.mapDimensionsAll(axis.dim), function (dim) {
                 axis.scale.unionExtentFromData(
                     // For example, the extent of the orginal dimension
                     // is [0.1, 0.5], the extent of the `stackResultDimension`
diff --git a/src/coord/polar/polarCreator.ts b/src/coord/polar/polarCreator.ts
index 67ee68e..b214779 100644
--- a/src/coord/polar/polarCreator.ts
+++ b/src/coord/polar/polarCreator.ts
@@ -86,12 +86,12 @@ function updatePolarScale(this: Polar, ecModel: 
GlobalModel, api: ExtensionAPI)
     ecModel.eachSeries(function (seriesModel) {
         if (seriesModel.coordinateSystem === polar) {
             const data = seriesModel.getData();
-            zrUtil.each(data.mapDimension('radius', true), function (dim) {
+            zrUtil.each(data.mapDimensionsAll('radius'), function (dim) {
                 radiusAxis.scale.unionExtentFromData(
                     data, getStackedDimension(data, dim)
                 );
             });
-            zrUtil.each(data.mapDimension('angle', true), function (dim) {
+            zrUtil.each(data.mapDimensionsAll('angle'), function (dim) {
                 angleAxis.scale.unionExtentFromData(
                     data, getStackedDimension(data, dim)
                 );
diff --git a/src/coord/single/Single.ts b/src/coord/single/Single.ts
index a4f1299..4d5324e 100644
--- a/src/coord/single/Single.ts
+++ b/src/coord/single/Single.ts
@@ -96,7 +96,7 @@ class Single implements CoordinateSystem, 
CoordinateSystemMaster {
         ecModel.eachSeries(function (seriesModel) {
             if (seriesModel.coordinateSystem === this) {
                 const data = seriesModel.getData();
-                each(data.mapDimension(this.dimension, true), function (dim) {
+                each(data.mapDimensionsAll(this.dimension), function (dim) {
                     this._axis.scale.unionExtentFromData(data, dim);
                 }, this);
                 axisHelper.niceScaleExtent(this._axis.scale, this._axis.model);
diff --git a/src/data/List.ts b/src/data/List.ts
index a13a6ef..53d4872 100644
--- a/src/data/List.ts
+++ b/src/data/List.ts
@@ -354,16 +354,12 @@ class List<
     /**
      * @param coordDim
      * @param idx A coordDim may map to more than one data dim.
-     *        If idx is `true`, return a array of all mapped dims.
-     *        If idx is not specified, return the first dim not extra.
-     * @return concrete data dim.
-     *        If idx is number, and not found, return null/undefined.
-     *        If idx is `true`, and not found, return empty array (always 
return array).
+     *        If not specified, return the first dim not extra.
+     * @return concrete data dim. If not found, return null/undefined
      */
     mapDimension(coordDim: DimensionName): DimensionName;
-    mapDimension(coordDim: DimensionName, idx: true): DimensionName[];
     mapDimension(coordDim: DimensionName, idx: number): DimensionName;
-    mapDimension(coordDim: DimensionName, idx?: true | number): DimensionName 
| DimensionName[] {
+    mapDimension(coordDim: DimensionName, idx?: number): DimensionName {
         const dimensionsSummary = this._dimensionsSummary;
 
         if (idx == null) {
diff --git a/src/model/Model.ts b/src/model/Model.ts
index 5f7d787..bd3e282 100644
--- a/src/model/Model.ts
+++ b/src/model/Model.ts
@@ -19,7 +19,6 @@
 
 import * as zrUtil from 'zrender/src/core/util';
 import env from 'zrender/src/core/env';
-import {makeInner} from '../util/model';
 import {
     enableClassExtend,
     ExtendableConstructor,
@@ -36,9 +35,6 @@ import { ModelOption } from '../util/types';
 import { Dictionary } from 'zrender/src/core/types';
 
 const mixin = zrUtil.mixin;
-const inner = makeInner<{
-    getParent(path: string | string[]): Model
-}, Model>();
 
 // Since model.option can be not only `Dictionary` but also primary types,
 // we do this conditional type to avoid getting type 'never';
@@ -119,10 +115,9 @@ class Model<Opt extends ModelOption = ModelOption> {    // 
TODO: TYPE use unkown
             return this.option;
         }
 
-        return doGet(
-            this.option,
+        return this._doGet(
             this.parsePath(path),
-            !ignoreParent && getParent(this, path)
+            !ignoreParent && this.parentModel
         );
     }
 
@@ -133,7 +128,7 @@ class Model<Opt extends ModelOption = ModelOption> {    // 
TODO: TYPE use unkown
 
         let val = option == null ? option : option[key];
         if (val == null && !ignoreParent) {
-            const parentModel = getParent(this, key as string);
+            const parentModel = this.parentModel;
             if (parentModel) {
                 // FIXME:TS do not know how to make it works
                 val = parentModel.getShallow(key);
@@ -162,13 +157,12 @@ class Model<Opt extends ModelOption = ModelOption> {    
// TODO: TYPE use unkown
         const hasPath = path != null;
         const pathFinal = hasPath ? this.parsePath(path) : null;
         const obj = hasPath
-            ? doGet(this.option, pathFinal)
+            ? this._doGet(pathFinal)
             : this.option;
 
-        let thisParentModel;
         parentModel = parentModel || (
-            (thisParentModel = getParent(this, pathFinal))
-                && thisParentModel.getModel(pathFinal as readonly [string])
+            this.parentModel
+                && this.parentModel.getModel(this.resolveParentPath(pathFinal) 
as [string])
         );
 
         return new Model(obj, parentModel, this.ecModel);
@@ -201,10 +195,11 @@ class Model<Opt extends ModelOption = ModelOption> {    
// TODO: TYPE use unkown
         return path;
     }
 
-    customizeGetParent(
-        getParentMethod: (path: string | string[]) => Model
-    ): void {
-        inner(this).getParent = getParentMethod;
+    // Resolve path for parent. Perhaps useful when parent use a different 
property.
+    // Default to be a identity resolver.
+    // Can be modified to a different resolver.
+    resolveParentPath(path: readonly string[]): string[] {
+        return path as string[];
     }
 
     // FIXME:TS check whether put this method here
@@ -219,32 +214,33 @@ class Model<Opt extends ModelOption = ModelOption> {    
// TODO: TYPE use unkown
         }
     }
 
-};
+    private _doGet(pathArr: readonly string[], parentModel?: 
Model<Dictionary<any>>) {
+        let obj = this.option;
+        if (!pathArr) {
+            return obj;
+        }
 
-function doGet(obj: ModelOption, pathArr: readonly string[], parentModel?: 
Model<Dictionary<any>>) {
-    for (let i = 0; i < pathArr.length; i++) {
-        // Ignore empty
-        if (!pathArr[i]) {
-            continue;
+        for (let i = 0; i < pathArr.length; i++) {
+            // Ignore empty
+            if (!pathArr[i]) {
+                continue;
+            }
+            // obj could be number/string/... (like 0)
+            obj = (obj && typeof obj === 'object') ? obj[pathArr[i] as keyof 
ModelOption] : null;
+            if (obj == null) {
+                break;
+            }
         }
-        // obj could be number/string/... (like 0)
-        obj = (obj && typeof obj === 'object') ? obj[pathArr[i] as keyof 
ModelOption] : null;
-        if (obj == null) {
-            break;
+        if (obj == null && parentModel) {
+            obj = parentModel._doGet(
+                this.resolveParentPath(pathArr) as [string],
+                parentModel.parentModel
+            ) as any;
         }
+
+        return obj;
     }
-    if (obj == null && parentModel) {
-        // TODO At most 3 items array. support string[]?
-        obj = parentModel.get(pathArr as [string]);
-    }
-    return obj;
-}
-
-// `path` can be null/undefined
-function getParent(model: Model, path: string | readonly string[]): Model {
-    const getParentMethod = inner(model).getParent;
-    return getParentMethod ? getParentMethod.call(model, path) : 
model.parentModel;
-}
+};
 
 type ModelConstructor = typeof Model
     & ExtendableConstructor
diff --git a/src/model/Series.ts b/src/model/Series.ts
index d6613bb..fbceb6f 100644
--- a/src/model/Series.ts
+++ b/src/model/Series.ts
@@ -475,7 +475,7 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> 
extends ComponentMode
         }
 
         const data = this.getData();
-        const tooltipDims = data.mapDimension('defaultedTooltip', true);
+        const tooltipDims = data.mapDimensionsAll('defaultedTooltip');
         const tooltipDimLen = tooltipDims.length;
         const value = this.getRawValue(dataIndex) as any;
         const isValueArr = zrUtil.isArray(value);
@@ -565,11 +565,11 @@ class SeriesModel<Opt extends SeriesOption = 
SeriesOption> extends ComponentMode
     }
 
     /**
-     * Use `data.mapDimension(coordDim, true)` instead.
+     * Use `data.mapDimensionsAll(coordDim)` instead.
      * @deprecated
      */
     coordDimToDataDim(coordDim: DimensionName): DimensionName[] {
-        return this.getRawData().mapDimension(coordDim, true);
+        return this.getRawData().mapDimensionsAll(coordDim);
     }
 
     /**
@@ -628,7 +628,7 @@ function autoSeriesName(seriesModel: SeriesModel): void {
 
 function getSeriesAutoName(seriesModel: SeriesModel): string {
     const data = seriesModel.getRawData();
-    const dataDims = data.mapDimension('seriesName', true);
+    const dataDims = data.mapDimensionsAll('seriesName');
     const nameArr: string[] = [];
     zrUtil.each(dataDims, function (dataDim) {
         const dimInfo = data.getDimensionInfo(dataDim);
diff --git a/src/model/mixin/dataFormat.ts b/src/model/mixin/dataFormat.ts
index 475a419..eca285f 100644
--- a/src/model/mixin/dataFormat.ts
+++ b/src/model/mixin/dataFormat.ts
@@ -18,9 +18,8 @@
 */
 
 import {retrieveRawValue} from '../../data/helper/dataProvider';
-import {getTooltipMarker, formatTpl} from '../../util/format';
-import { getTooltipRenderMode } from '../../util/model';
-import { DataHost, DisplayState, TooltipRenderMode, CallbackDataParams, 
ColorString } from '../../util/types';
+import {formatTpl} from '../../util/format';
+import { DataHost, DisplayState, TooltipRenderMode, CallbackDataParams, 
ColorString, ZRColor } from '../../util/types';
 import GlobalModel from '../Global';
 import Element from 'zrender/src/Element';
 
@@ -53,12 +52,8 @@ class DataFormatMixin {
         const name = data.getName(dataIndex);
         const itemOpt = data.getRawDataItem(dataIndex);
         const style = data.getItemVisual(dataIndex, 'style');
-        const color = style && style.fill as ColorString;
+        const color = style && style[data.getItemVisual(dataIndex, 'drawType') 
|| 'fill'] as ZRColor;
         const borderColor = style && style.stroke as ColorString;
-        const tooltipModel = this.ecModel.getComponent('tooltip');
-        // @ts-ignore FIXME:TooltipModel
-        const renderModeOption = tooltipModel && 
tooltipModel.get('renderMode');
-        const renderMode = getTooltipRenderMode(renderModeOption);
         const mainType = this.mainType;
         const isSeries = mainType === 'series';
         const userOutput = data.userOutput;
@@ -80,10 +75,6 @@ class DataFormatMixin {
             borderColor: borderColor,
             dimensionNames: userOutput ? userOutput.dimensionNames : null,
             encode: userOutput ? userOutput.encode : null,
-            marker: getTooltipMarker({
-                color: color,
-                renderMode: renderMode
-            }),
 
             // Param name list for mapping `a`, `b`, `c`, `d`, `e`
             $vars: ['seriesName', 'name', 'value']
diff --git a/src/util/graphic.ts b/src/util/graphic.ts
index 727fd40..9a35173 100644
--- a/src/util/graphic.ts
+++ b/src/util/graphic.ts
@@ -638,8 +638,6 @@ export function setLabelStyle<LDI>(
 ) {
     opt = opt || EMPTY_OBJ;
     const isSetOnText = targetEl instanceof ZRText;
-    // This scenario, `label.normal.show = true; label.emphasis.show = false`,
-    // is not supported util someone requests.
 
     const showNormal = normalModel.getShallow('show');
     const showEmphasis = emphasisModel.getShallow('show');
@@ -742,7 +740,6 @@ export function setLabelStyle<LDI>(
 
 /**
  * Set basic textStyle properties.
- * See more info in `setTextStyleCommon`.
  */
 export function createTextStyle(
     textStyleModel: Model,
@@ -805,6 +802,7 @@ export function createTextConfig(
     }
     if (!textStyle.stroke) {
         textConfig.insideStroke = 'auto';
+        // textConfig.outsideStroke = 'auto';
     }
     else if (opt.autoColor) {
         // TODO: stroke set to autoColor. if label is inside?
diff --git a/src/visual/style.ts b/src/visual/style.ts
index 6f0015d..605edee 100644
--- a/src/visual/style.ts
+++ b/src/visual/style.ts
@@ -209,4 +209,8 @@ const dataColorPaletteTask: StageHandler = {
     }
 };
 
-export {seriesStyleTask, dataStyleTask, dataColorPaletteTask};
\ No newline at end of file
+export {
+    seriesStyleTask,
+    dataStyleTask,
+    dataColorPaletteTask
+};
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to