You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/03/06 08:51:46 UTC

[GitHub] [echarts] leosxie opened a new pull request #14413: fix(series): fix series data type judgment bug. close #14293

leosxie opened a new pull request #14413:
URL: https://github.com/apache/echarts/pull/14413


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   -  bug fixing #14293 
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#issuecomment-791897840


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] leosxie commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
leosxie commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589152798



##########
File path: src/model/Series.ts
##########
@@ -575,8 +575,8 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
         if (data.hasItemOption) {
             data.each(function (idx) {
                 const rawItem = data.getRawDataItem(idx);
-                if (typeof rawItem === 'object'
-                    && (rawItem as OptionDataItemObject<unknown>).selected
+                if (zrUtil.isObject(rawItem)
+                    && (rawItem as OptionDataItemObject<unknown>)?.selected

Review comment:
       use zrUtil.isObject(rawItem) replace in here may be more safe?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589172013



##########
File path: .history/src/model/Series_20210308122052.ts
##########
@@ -0,0 +1,693 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one

Review comment:
       This file should not be committed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589133025



##########
File path: src/model/Series.ts
##########
@@ -575,8 +575,8 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
         if (data.hasItemOption) {
             data.each(function (idx) {
                 const rawItem = data.getRawDataItem(idx);
-                if (typeof rawItem === 'object'
-                    && (rawItem as OptionDataItemObject<unknown>).selected
+                if (zrUtil.isObject(rawItem)
+                    && (rawItem as OptionDataItemObject<unknown>)?.selected

Review comment:
       Optional chaining will be transpiled to
   ```js
   rawItem === null || rawItem === void 0 ? void 0 : rawItem.selected;
   ```
   and brings extra codes in the final distribution.
   
   So we limited the use of optional chaining in echarts to keep the distribution as small as possible.
   
   Instead 
   ```ts
   (rawItem && (rawItem as OptionDataItemObject<unknown>).selected)
   ```
   is enough here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang merged pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
pissang merged pull request #14413:
URL: https://github.com/apache/echarts/pull/14413


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] leosxie commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
leosxie commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589152798



##########
File path: src/model/Series.ts
##########
@@ -575,8 +575,8 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
         if (data.hasItemOption) {
             data.each(function (idx) {
                 const rawItem = data.getRawDataItem(idx);
-                if (typeof rawItem === 'object'
-                    && (rawItem as OptionDataItemObject<unknown>).selected
+                if (zrUtil.isObject(rawItem)
+                    && (rawItem as OptionDataItemObject<unknown>)?.selected

Review comment:
       use zrUtil.isObject(rawItem) replace in here may be more safe?@pissang




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#issuecomment-792478553


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589155773



##########
File path: src/model/Series.ts
##########
@@ -575,8 +575,7 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
         if (data.hasItemOption) {
             data.each(function (idx) {
                 const rawItem = data.getRawDataItem(idx);
-                if (typeof rawItem === 'object'
-                    && (rawItem as OptionDataItemObject<unknown>).selected
+                if (rawItem && (rawItem as OptionDataItemObject<unknown>).selected
                 ) {

Review comment:
       No need to newline here for a better code style.
   ```ts
   if (rawItem && (rawItem as OptionDataItemObject<unknown>).selected) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] leosxie commented on a change in pull request #14413: fix(series): fix series data type judgment bug. close #14293

Posted by GitBox <gi...@apache.org>.
leosxie commented on a change in pull request #14413:
URL: https://github.com/apache/echarts/pull/14413#discussion_r589146788



##########
File path: src/model/Series.ts
##########
@@ -575,8 +575,8 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
         if (data.hasItemOption) {
             data.each(function (idx) {
                 const rawItem = data.getRawDataItem(idx);
-                if (typeof rawItem === 'object'
-                    && (rawItem as OptionDataItemObject<unknown>).selected
+                if (zrUtil.isObject(rawItem)
+                    && (rawItem as OptionDataItemObject<unknown>)?.selected

Review comment:
       get it




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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