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/11/25 14:22:46 UTC

[echarts] branch fix-null-check created (now c0a9277cc)

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

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


      at c0a9277cc fix(core): use `!=` to check if series is excluded as native map returns `undefined` rather than `null`

This branch includes the following new commits:

     new 8985de838 chore(log): use warn util instead of `console.warn`
     new b8f16efdc chore: use `hasGlobalWindow` constant from env util.
     new c0a9277cc fix(core): use `!=` to check if series is excluded as native map returns `undefined` rather than `null`

The 3 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] 03/03: fix(core): use `!=` to check if series is excluded as native map returns `undefined` rather than `null`

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

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

commit c0a9277cc63db8307dd3642684ebc467e2c38f91
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Nov 25 22:18:45 2022 +0800

    fix(core): use `!=` to check if series is excluded as native map returns `undefined` rather than `null`
---
 src/core/echarts.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/echarts.ts b/src/core/echarts.ts
index e84c1c89e..7775e6d50 100644
--- a/src/core/echarts.ts
+++ b/src/core/echarts.ts
@@ -1580,7 +1580,7 @@ class ECharts extends Eventful<ECEventDefinition> {
 
             // If dispatchAction before setOption, do nothing.
             ecModel && ecModel.eachComponent(condition, function (model) {
-                const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null;
+                const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;
                 if (isExcluded) {
                     return;
                 };
@@ -1624,7 +1624,7 @@ class ECharts extends Eventful<ECEventDefinition> {
             }, ecIns);
 
             ecModel && ecModel.eachComponent(condition, function (model) {
-                const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) !== null;
+                const isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;
                 if (isExcluded) {
                     return;
                 };


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


[echarts] 01/03: chore(log): use warn util instead of `console.warn`

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

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

commit 8985de83843038696e39be10c547fdbd94b69eb3
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Nov 25 22:01:45 2022 +0800

    chore(log): use warn util instead of `console.warn`
---
 src/core/echarts.ts | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/core/echarts.ts b/src/core/echarts.ts
index 3724b48af..8a4283828 100644
--- a/src/core/echarts.ts
+++ b/src/core/echarts.ts
@@ -112,7 +112,7 @@ import {
 import Displayable from 'zrender/src/graphic/Displayable';
 import { seriesSymbolTask, dataSymbolTask } from '../visual/symbol';
 import { getVisualFromData, getItemVisualFromData } from '../visual/helper';
-import { deprecateLog, deprecateReplaceLog, error } from '../util/log';
+import { deprecateLog, deprecateReplaceLog, error, warn } from '../util/log';
 import { handleLegacySelectEvents } from '../legacy/dataSelectAction';
 
 import { registerExternalTransform } from '../data/helper/transform';
@@ -974,7 +974,7 @@ class ECharts extends Eventful<ECEventDefinition> {
                     }
                     else {
                         if (__DEV__) {
-                            console.warn(key + ': ' + (view
+                            warn(key + ': ' + (view
                                 ? 'The found component do not support containPoint.'
                                 : 'No view mapping to the found component.'
                             ));
@@ -983,7 +983,7 @@ class ECharts extends Eventful<ECEventDefinition> {
                 }
                 else {
                     if (__DEV__) {
-                        console.warn(key + ': containPoint is not supported');
+                        warn(key + ': containPoint is not supported');
                     }
                 }
             }, this);
@@ -1018,7 +1018,7 @@ class ECharts extends Eventful<ECEventDefinition> {
 
         if (__DEV__) {
             if (!seriesModel) {
-                console.warn('There is no specified seires model');
+                warn('There is no specified series model');
             }
         }
 
@@ -1113,7 +1113,7 @@ class ECharts extends Eventful<ECEventDefinition> {
                         // be missed, otherwise there is no way to distinguish source component.
                         // See `dataFormat.getDataParams`.
                         if (!isGlobalOut && !(model && view)) {
-                            console.warn('model or view can not be found by params');
+                            warn('model or view can not be found by params');
                         }
                     }
 
@@ -1304,7 +1304,7 @@ class ECharts extends Eventful<ECEventDefinition> {
         this.hideLoading();
         if (!loadingEffects[name]) {
             if (__DEV__) {
-                console.warn('Loading effects ' + name + ' not exists.');
+                warn('Loading effects ' + name + ' not exists.');
             }
             return;
         }
@@ -1863,7 +1863,7 @@ class ECharts extends Eventful<ECEventDefinition> {
             }
 
             if (__DEV__) {
-                console.warn(
+                warn(
                     'No coordinate system that supports ' + methodName + ' found by the given finder.'
                 );
             }
@@ -2594,7 +2594,7 @@ const MOUSE_EVENT_NAMES: ZRElementEventName[] = [
 
 function disposedWarning(id: string): void {
     if (__DEV__) {
-        console.warn('Instance ' + id + ' has been disposed');
+        warn('Instance ' + id + ' has been disposed');
     }
 }
 
@@ -2655,7 +2655,7 @@ export function init(
         const existInstance = getInstanceByDom(dom);
         if (existInstance) {
             if (__DEV__) {
-                console.warn('There is a chart instance already initialized on the dom.');
+                warn('There is a chart instance already initialized on the dom.');
             }
             return existInstance;
         }
@@ -2668,7 +2668,7 @@ export function init(
                     || (!dom.clientHeight && (!opts || opts.height == null))
                 )
             ) {
-                console.warn('Can\'t get DOM width or height. Please check '
+                warn('Can\'t get DOM width or height. Please check '
                 + 'dom.clientWidth and dom.clientHeight. They should not be 0.'
                 + 'For example, you may need to call this in the callback '
                 + 'of window.onload.');


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


[echarts] 02/03: chore: use `hasGlobalWindow` constant from env util.

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

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

commit b8f16efdce09030e2f36502b6e1e2a4d4cd33c88
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Nov 25 22:06:34 2022 +0800

    chore: use `hasGlobalWindow` constant from env util.
---
 src/core/echarts.ts | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/core/echarts.ts b/src/core/echarts.ts
index 8a4283828..e84c1c89e 100644
--- a/src/core/echarts.ts
+++ b/src/core/echarts.ts
@@ -137,8 +137,6 @@ declare let global: any;
 
 type ModelFinder = modelUtil.ModelFinder;
 
-const hasWindow = typeof window !== 'undefined';
-
 export const version = '5.4.0';
 
 export const dependencies = {
@@ -417,7 +415,7 @@ class ECharts extends Eventful<ECEventDefinition> {
         if (__DEV__) {
             const root = (
                 /* eslint-disable-next-line */
-                hasWindow ? window : global
+                env.hasGlobalWindow ? window : global
             ) as any;
 
             defaultRenderer = root.__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer;
@@ -705,7 +703,7 @@ class ECharts extends Eventful<ECEventDefinition> {
     getDevicePixelRatio(): number {
         return (this._zr.painter as CanvasPainter).dpr
             /* eslint-disable-next-line */
-            || (hasWindow && window.devicePixelRatio) || 1;
+            || (env.hasGlobalWindow && window.devicePixelRatio) || 1;
     }
 
     /**


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