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/03 03:42:12 UTC

[echarts] branch fix-coord-dimensions created (now 43eb8ae)

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

shenyi pushed a change to branch fix-coord-dimensions
in repository https://gitbox.apache.org/repos/asf/echarts.git.


      at 43eb8ae  fix(coord): fix coord dimension undefined for 3rd libs

This branch includes the following new commits:

     new 43eb8ae  fix(coord): fix coord dimension undefined for 3rd libs

The 1 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/01: fix(coord): fix coord dimension undefined for 3rd libs

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

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

commit 43eb8aebf88ed0f035bee2394e6d4512a3c4526b
Author: pissang <bm...@gmail.com>
AuthorDate: Sat Jul 3 11:38:06 2021 +0800

    fix(coord): fix coord dimension undefined for 3rd libs
---
 src/coord/geo/Geo.ts              | 4 +++-
 src/coord/geo/geoCreator.ts       | 4 ++--
 src/coord/polar/Polar.ts          | 4 +++-
 src/coord/polar/polarCreator.ts   | 4 ++--
 src/coord/single/Single.ts        | 3 ++-
 src/coord/single/singleCreator.ts | 4 ++--
 6 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/coord/geo/Geo.ts b/src/coord/geo/Geo.ts
index aa15eba..a3896c1 100644
--- a/src/coord/geo/Geo.ts
+++ b/src/coord/geo/Geo.ts
@@ -44,10 +44,12 @@ const GEO_DEFAULT_PARAMS: {
     }
 } as const;
 
+export const geo2DDimensions = ['lng', 'lat'];
+
 
 class Geo extends View {
 
-    dimensions = ['lng', 'lat'];
+    dimensions = geo2DDimensions;
 
     type = 'geo';
 
diff --git a/src/coord/geo/geoCreator.ts b/src/coord/geo/geoCreator.ts
index 618d098..daef283 100644
--- a/src/coord/geo/geoCreator.ts
+++ b/src/coord/geo/geoCreator.ts
@@ -18,7 +18,7 @@
 */
 
 import * as zrUtil from 'zrender/src/core/util';
-import Geo from './Geo';
+import Geo, { geo2DDimensions } from './Geo';
 import * as layout from '../../util/layout';
 import * as numberUtil from '../../util/number';
 import geoSourceManager from './geoSourceManager';
@@ -130,7 +130,7 @@ function setGeoCoords(geo: Geo, model: MapSeries) {
 class GeoCreator implements CoordinateSystemCreator {
 
     // For deciding which dimensions to use when creating list data
-    dimensions = Geo.prototype.dimensions;
+    dimensions = geo2DDimensions;
 
     create(ecModel: GlobalModel, api: ExtensionAPI): Geo[] {
         const geoList = [] as Geo[];
diff --git a/src/coord/polar/Polar.ts b/src/coord/polar/Polar.ts
index 4e53b13..912f6c7 100644
--- a/src/coord/polar/Polar.ts
+++ b/src/coord/polar/Polar.ts
@@ -26,6 +26,8 @@ import { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model';
 import { ScaleDataValue } from '../../util/types';
 import ExtensionAPI from '../../core/ExtensionAPI';
 
+export const polarDimensions = ['radius', 'angle'];
+
 interface Polar {
     update(ecModel: GlobalModel, api: ExtensionAPI): void
 }
@@ -33,7 +35,7 @@ class Polar implements CoordinateSystem, CoordinateSystemMaster {
 
     readonly name: string;
 
-    readonly dimensions = ['radius', 'angle'];
+    readonly dimensions = polarDimensions;
 
     readonly type = 'polar';
 
diff --git a/src/coord/polar/polarCreator.ts b/src/coord/polar/polarCreator.ts
index 2b00a2d..69feeca 100644
--- a/src/coord/polar/polarCreator.ts
+++ b/src/coord/polar/polarCreator.ts
@@ -20,7 +20,7 @@
 // TODO Axis scale
 
 import * as zrUtil from 'zrender/src/core/util';
-import Polar from './Polar';
+import Polar, { polarDimensions } from './Polar';
 import {parsePercent} from '../../util/number';
 import {
     createScaleByModel,
@@ -132,7 +132,7 @@ function setAxis(axis: RadiusAxis | AngleAxis, axisModel: PolarAxisModel) {
 
 const polarCreator = {
 
-    dimensions: Polar.prototype.dimensions,
+    dimensions: polarDimensions,
 
     create: function (ecModel: GlobalModel, api: ExtensionAPI) {
         const polarList: Polar[] = [];
diff --git a/src/coord/single/Single.ts b/src/coord/single/Single.ts
index cee845b..5ad4031 100644
--- a/src/coord/single/Single.ts
+++ b/src/coord/single/Single.ts
@@ -33,6 +33,7 @@ import SingleAxisModel from './AxisModel';
 import { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model';
 import { ScaleDataValue } from '../../util/types';
 
+export const singleDimensions = ['single'];
 /**
  * Create a single coordinates system.
  */
@@ -44,7 +45,7 @@ class Single implements CoordinateSystem, CoordinateSystemMaster {
     /**
      * Add it just for draw tooltip.
      */
-    readonly dimensions = ['single'];
+    readonly dimensions = singleDimensions;
 
     name: string;
 
diff --git a/src/coord/single/singleCreator.ts b/src/coord/single/singleCreator.ts
index 5373950..1c2c584 100644
--- a/src/coord/single/singleCreator.ts
+++ b/src/coord/single/singleCreator.ts
@@ -21,7 +21,7 @@
  * Single coordinate system creator.
  */
 
-import Single from './Single';
+import Single, { singleDimensions } from './Single';
 import GlobalModel from '../../model/Global';
 import ExtensionAPI from '../../core/ExtensionAPI';
 import SingleAxisModel from './AxisModel';
@@ -62,7 +62,7 @@ function create(ecModel: GlobalModel, api: ExtensionAPI) {
 
 const singleCreator = {
     create: create,
-    dimensions: Single.prototype.dimensions
+    dimensions: singleDimensions
 };
 
 export default singleCreator;
\ 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