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/09/04 17:49:51 UTC

[GitHub] [echarts] susiwen8 opened a new pull request #15677: Fix(MarkerLine): convert date string to timestamp

susiwen8 opened a new pull request #15677:
URL: https://github.com/apache/echarts/pull/15677


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   Convert date string to timestamp
   
   
   
   ### Fixed issues
   #15675 
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <img width="666" alt="Screen Shot 2021-09-05 at 1 47 17 AM" src="https://user-images.githubusercontent.com/20318608/132103827-8a5bd036-7fed-47f8-82ff-39c311804ba9.png">
   
   
   
   
   ### After: How is it fixed in this PR?
   <img width="665" alt="Screen Shot 2021-09-05 at 1 46 57 AM" src="https://user-images.githubusercontent.com/20318608/132103835-4c3dd49f-0afe-4998-98a1-89db9ba96a19.png">
   
   
   
   
   ## Misc
   
   <!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
   
   - [ ] The API has been changed (apache/echarts-doc#xxx).
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   NA.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] susiwen8 closed pull request #15677: Fix(MarkerLine): convert date string to timestamp

Posted by GitBox <gi...@apache.org>.
susiwen8 closed pull request #15677:
URL: https://github.com/apache/echarts/pull/15677


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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 #15677: Fix(MarkerLine): convert date string to timestamp

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



##########
File path: src/data/DataStore.ts
##########
@@ -408,9 +409,13 @@ class DataStore {
                 for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
                     const dimStorage = chunks[dimIdx];
                     // PENDING NULL is empty or zero
-                    const val = this._dimValueGetter(
+                    let val = this._dimValueGetter(
                         dataItem, dimNames[dimIdx], idx, dimIdx
                     ) as ParsedValueNumeric;
+
+                    if (this._dimensions[dimIdx].type === 'time') {

Review comment:
       By the original design. The string time format will be stored in a normal array. Otherwise, it will be parsed in dimValueGetter like in https://github.com/apache/echarts/blob/53fa03d271e1ca696ebec6ae2c94e76e946883ae/src/data/helper/dataValueHelper.ts#L58
   
   But I suppose this is broken after some changes.

##########
File path: src/data/DataStore.ts
##########
@@ -408,9 +409,13 @@ class DataStore {
                 for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
                     const dimStorage = chunks[dimIdx];
                     // PENDING NULL is empty or zero
-                    const val = this._dimValueGetter(
+                    let val = this._dimValueGetter(
                         dataItem, dimNames[dimIdx], idx, dimIdx
                     ) as ParsedValueNumeric;
+
+                    if (this._dimensions[dimIdx].type === 'time') {

Review comment:
       By the original design. The string time format will be stored in a normal array. Otherwise, it should be parsed in dimValueGetter like in https://github.com/apache/echarts/blob/53fa03d271e1ca696ebec6ae2c94e76e946883ae/src/data/helper/dataValueHelper.ts#L58
   
   But I suppose this is broken after some changes.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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 #15677: Fix(MarkerLine): convert date string to timestamp

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


   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).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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 #15677: Fix(MarkerLine): convert date string to timestamp

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



##########
File path: src/data/DataStore.ts
##########
@@ -408,9 +409,13 @@ class DataStore {
                 for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
                     const dimStorage = chunks[dimIdx];
                     // PENDING NULL is empty or zero
-                    const val = this._dimValueGetter(
+                    let val = this._dimValueGetter(
                         dataItem, dimNames[dimIdx], idx, dimIdx
                     ) as ParsedValueNumeric;
+
+                    if (this._dimensions[dimIdx].type === 'time') {

Review comment:
       It's a very hotspot code so performance should be taken carefully. And I'm not sure but this fix seems more like a workaround. One thing that can be sure is that this bug is brought in https://github.com/apache/echarts/pull/15355. I will figure out why `time` format data breaks in this case.  




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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] susiwen8 commented on a change in pull request #15677: Fix(MarkerLine): convert date string to timestamp

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



##########
File path: src/data/DataStore.ts
##########
@@ -408,9 +409,13 @@ class DataStore {
                 for (let dimIdx = 0; dimIdx < dimLen; dimIdx++) {
                     const dimStorage = chunks[dimIdx];
                     // PENDING NULL is empty or zero
-                    const val = this._dimValueGetter(
+                    let val = this._dimValueGetter(
                         dataItem, dimNames[dimIdx], idx, dimIdx
                     ) as ParsedValueNumeric;
+
+                    if (this._dimensions[dimIdx].type === 'time') {

Review comment:
       ```js
   const a = new Float64Array();
   a[0] = '2018-01-02';
   console.log(a) // [NaN]
   ```
   




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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