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 2021/07/15 02:36:26 UTC

[echarts] 01/02: refact(data): fix marker

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

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

commit e026f3fc256aabbe96686e522ff064ab3bf89d4b
Author: pissang <bm...@gmail.com>
AuthorDate: Wed Jul 14 21:50:08 2021 +0800

    refact(data): fix marker
---
 src/component/marker/MarkAreaView.ts  | 10 ++++++----
 src/component/marker/MarkLineView.ts  |  6 +++++-
 src/component/marker/MarkPointView.ts | 13 ++++++++-----
 src/data/SeriesData.ts                |  2 +-
 test/timeline-event.html              |  2 +-
 5 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/src/component/marker/MarkAreaView.ts b/src/component/marker/MarkAreaView.ts
index e4faafd..d5aadad 100644
--- a/src/component/marker/MarkAreaView.ts
+++ b/src/component/marker/MarkAreaView.ts
@@ -26,7 +26,7 @@ import * as graphic from '../../util/graphic';
 import { enableHoverEmphasis, setStatesStylesFromModel } from '../../util/states';
 import * as markerHelper from './markerHelper';
 import MarkerView from './MarkerView';
-import { retrieve, mergeAll, map, defaults, curry, filter, HashMap } from 'zrender/src/core/util';
+import { retrieve, mergeAll, map, defaults, curry, filter, HashMap, extend } from 'zrender/src/core/util';
 import { ScaleDataValue, ParsedValue, ZRColor } from '../../util/types';
 import { CoordinateSystem, isCoordinateSystemType } from '../../coord/CoordinateSystem';
 import MarkAreaModel, { MarkArea2DDataItemOption } from './MarkAreaModel';
@@ -372,9 +372,11 @@ function createList(
                 data.mapDimension(coordDim)
             ) || {};
             // In map series data don't have lng and lat dimension. Fallback to same with coordSys
-            return defaults({
-                name: coordDim
-            }, info);
+            return extend(extend({}, info), {
+                name: coordDim,
+                // DON'T use ordinalMeta to parse and collect ordinal.
+                ordinalMeta: null
+            });
         });
         areaData = new SeriesData(map(dims, function (dim, idx) {
             return {
diff --git a/src/component/marker/MarkLineView.ts b/src/component/marker/MarkLineView.ts
index 23901cc..212ce68 100644
--- a/src/component/marker/MarkLineView.ts
+++ b/src/component/marker/MarkLineView.ts
@@ -442,7 +442,11 @@ function createList(coordSys: CoordinateSystem, seriesModel: SeriesModel, mlMode
                 seriesModel.getData().mapDimension(coordDim)
             ) || {};
             // In map series data don't have lng and lat dimension. Fallback to same with coordSys
-            return defaults({name: coordDim}, info);
+            return extend(extend({}, info), {
+                name: coordDim,
+                // DON'T use ordinalMeta to parse and collect ordinal.
+                ordinalMeta: null
+            });
         });
     }
     else {
diff --git a/src/component/marker/MarkPointView.ts b/src/component/marker/MarkPointView.ts
index e82fe73..f0693da 100644
--- a/src/component/marker/MarkPointView.ts
+++ b/src/component/marker/MarkPointView.ts
@@ -29,7 +29,7 @@ import MarkPointModel, {MarkPointDataItemOption} from './MarkPointModel';
 import GlobalModel from '../../model/Global';
 import MarkerModel from './MarkerModel';
 import ExtensionAPI from '../../core/ExtensionAPI';
-import { HashMap, isFunction, map, defaults, filter, curry } from 'zrender/src/core/util';
+import { HashMap, isFunction, map, defaults, filter, curry, extend } from 'zrender/src/core/util';
 import { getECData } from '../../util/innerStore';
 import { getVisualFromData } from '../../visual/helper';
 import { ZRColor } from '../../util/types';
@@ -59,7 +59,6 @@ function updateMarkerLayout(
             const x = mpData.get(coordSys.dimensions[0], idx);
             const y = mpData.get(coordSys.dimensions[1], idx);
             point = coordSys.dataToPoint([x, y]);
-
         }
 
         // Use x, y if has any
@@ -108,7 +107,7 @@ class MarkPointView extends MarkerView {
         const symbolDraw = symbolDrawMap.get(seriesId)
             || symbolDrawMap.set(seriesId, new SymbolDraw());
 
-        const mpData = createList(coordSys, seriesModel, mpModel);
+        const mpData = createData(coordSys, seriesModel, mpModel);
 
         // FIXME
         mpModel.setData(mpData);
@@ -176,7 +175,7 @@ class MarkPointView extends MarkerView {
     }
 }
 
-function createList(
+function createData(
     coordSys: CoordinateSystem,
     seriesModel: SeriesModel,
     mpModel: MarkPointModel
@@ -188,7 +187,11 @@ function createList(
                 seriesModel.getData().mapDimension(coordDim)
             ) || {};
             // In map series data don't have lng and lat dimension. Fallback to same with coordSys
-            return defaults({name: coordDim}, info);
+            return extend(extend({}, info), {
+                name: coordDim,
+                // DON'T use ordinalMeta to parse and collect ordinal.
+                ordinalMeta: null
+            });
         });
     }
     else {
diff --git a/src/data/SeriesData.ts b/src/data/SeriesData.ts
index e2e5345..ad280b0 100644
--- a/src/data/SeriesData.ts
+++ b/src/data/SeriesData.ts
@@ -658,8 +658,8 @@ class SeriesData<
     getValues(dimensions: readonly DimensionName[] | number, idx?: number): ParsedValue[] {
         const values = [];
         if (!zrUtil.isArray(dimensions)) {
-            // stack = idx;
             idx = dimensions as number;
+            // TODO get all from store?
             dimensions = this.dimensions;
         }
 
diff --git a/test/timeline-event.html b/test/timeline-event.html
index c46e627..621afb4 100644
--- a/test/timeline-event.html
+++ b/test/timeline-event.html
@@ -23,7 +23,7 @@ under the License.
     <head>
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1" />
-        <script src="lib/esl.js"></script>
+        <script src="lib/simpleRequire.js"></script>
         <script src="lib/config.js"></script>
         <script src="lib/jquery.min.js"></script>
         <script src="lib/facePrint.js"></script>

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