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/11/23 03:38:37 UTC

[GitHub] [echarts] eapatel opened a new issue #16095: appendData crashed the tab after sometimes in 3d globe.

eapatel opened a new issue #16095:
URL: https://github.com/apache/echarts/issues/16095


   ### Version
   4.0.2
   
   ### Steps to reproduce
   I am using appendData to load real time data in 3d globe. It works fine for 2 or 3 minutes and then the page starts to freeze. Also if I went to another tab and stay for some time and then came back, that tab crashes.
   
   Please suggest any way to solve this problem or it would be great if any removeData method will be available so that I can delete some old records from the graph and it'll solved browser crashed issue as well.
   ```
   this.echartsInstance.appendData({
         seriesIndex: '0',      
         data:[ 
             [SRCLATLON, DSTLATLON]   
          ]
       });
   ```
   ```
   this.echartsInstance.appendData({           
         seriesIndex: '1',
         data: [
           {
             value: [SRCLATLON],
           }, {          
             value: DSTLATLON],
           }
         ]
       });
   ```
   ```
       this.option = {
         legend: this.getLegend(),
         tooltip: {
           show: true,
           trigger: 'item',
           ....
         },
         globe: {
           globeRadius: 80,
            ....
         }      
         series: [ LinesSeries(), PointsSeries() ],
       };
   ```
   ```
    getLinesSeries() {
       return {
         type: 'lines3D',
         name: 'data',     
         data: [],
          ...
       };
     }
   ```
   ```
     PointsSeries() {
       return {
         type: 'scatter3D',
         name: 'data',
         coordinateSystem: 'globe',          
         data: []
          ...
       };
     }
   ```
   
   ### What is expected?
   3d Globe should keep loading real time data without browser freezing and crashing of the tab.
   
   ### What is actually happening?
   The browser gets freeze after some times and/or crash the tab
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   will try use replaceMerge by upgrading echarts with v5


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   Below is my code using setOption.
   ```
    <div style="width:100%; height:100%"
       [options]="option"
       (chartInit)="onChartInit($event)">
   </div>
   ```
   ```
    echartsInstance: any;
    option: EChartOption = {};
   flag: boolean = false;
   data: any;
    ```
   ```
   constructor() {
             this.setOption();
             
             this.mySerive.getData().subscribe( res => {
                   if (res) {  this.data = res; }      
             });        
             
             if(this.echartsInstance) {
               this.updateSeries();
             }
         }
       });
   }
   ```
   ```
    setOptions() {
       this.option = {
         legend: {        
           selected: this.selectedLegend,
           selected: {},
           selectedMode: 'multiple',        
           type: 'scroll',
           orient: 'vertical',
           right: 23,
           top: 83,
           data: [],
           icon: 'roundRect'       
         },
         globe: {
           globeRadius: 80,
           ...
         },
         series: []
       };
     }
   ```
   ```
    LinesSeries() {
       return {
         type: 'lines3D',
         name: 'data',     
         data: [ 
             [data.SRCLATLON, data.DSTLATLON]   
          ],
          ...
       };
     }
   
     PointsSeries() {
       return {
         type: 'scatter3D',
         name: 'data',
         coordinateSystem: 'globe',          
         data: [
           {
             value: [data.SRCLATLON],
           }, {          
             value: [data.DSTLATLON],
           }
         ]
          ...
       };
     }
   ```
   ```
   updateSeries() {
      if (!this.flag &&  this.option.series.length > 100) { this.flag = true; }
      if(this.flag) { this.option.series.splice(0,2); }
      
      this.option.series.push(this.LinesSeries(), this.PointsSeries());
      this.echartsInstance.setOption({series: this.option.series});
   }
   ```
   ```
   onChartInit(event: any) {
       if (this.alive) {
         this.echartsInstance = event; 
       }
     }
   ```


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-981184109






-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977415394


   Thanks for the response @pissang.
   
   I also used setOptions to update the data and was accumulating only 100 data. For example, when the length of the series reaches 100 then start deleting the first data (e.g. series.data[0]) and adding new data at the end. However, with this concept, browser freezes since from the beginning when updating the data. 
   
   While with appendData, I can at least see browser gets freeze after certain time say for example after half and hour or so and this is because I'm not finding any way to remove old data.
   
   So I'm looking for a way to delete the old data so that the browser works smoothly. For example when the length of the series reaches 100 then start deleting the first data (e.g. series.data[0]) and add new data at the end. Is it possible to achieve with appendData?


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-981184109


   Hi @pissang, I solved above error. As I upgraded from echarts v4.0.2 to echarts v5.2.2 I'm getting below error.
   ```
   Type '(params: any, ticket: any, callback: any) => any' is not assignable to type 'string | TooltipFormatterCallback<TopLevelFormatterParams>'.
         Type '(params: any, ticket: any, callback: any) => any' is not assignable to type 'TooltipFormatterCallback<TopLevelFormatterParams>'.
       
       87         formatter: (params, ticket, callback) => {
    ```   
       ```
   Type '{ formatter: (value: any) => any; }' is not assignable to type 
   'AxisLabelBaseOption'.
         Object literal may only specify known properties, and 'formatter' does not exist in type 'AxisLabelBaseOption'.
       
       134           formatter: (value): any => this.formatXAxisLabel(value),    
       ```
   Formatter works fine with version 4.0.2. can you please help me how to solve this with echarts v5?


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-994238432


   Hi @pissang, any updates here. I need the solution for it. It's really blocking my project release.


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-988370985


   Hi @pissang , can you please provide solution for appendData? I am very close to release and this issue is blocker for it. Really need a solution to improve the performance of globe.


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   Below is my code using setOption.
   
    <div style="width:100%; height:100%"
       [options]="option"
       (chartInit)="onChartInit($event)">
   </div>
   
    echartsInstance: any;
    option: EChartOption = {};
   data: any;
    
   constructor() {
             this.setOption();
             
             this.mySerive.getData().subscribe( res => {
                   if (res) {  this.data = res; }      
             });        
             
             if(this.echartsInstance) {
               this.updateSeries();
             }
         }
       });
   }
   
    setOptions() {
       this.option = {
         legend: {        
           selected: this.selectedLegend,
           selected: {},
           selectedMode: 'multiple',        
           type: 'scroll',
           orient: 'vertical',
           right: 23,
           top: 83,
           data: [],
           icon: 'roundRect'       
         },
         globe: {
           globeRadius: 80,
           ...
         },
         series: []
       };
     }
   
    LinesSeries() {
       return {
         type: 'lines3D',
         name: 'data',     
         data: [ 
             [data.SRCLATLON, data.DSTLATLON]   
          ],
          ...
       };
     }
     PointsSeries() {
       return {
         type: 'scatter3D',
         name: 'data',
         coordinateSystem: 'globe',          
         data: [
           {
             value: [data.SRCLATLON],
           }, {          
             value: [data.DSTLATLON],
           }
         ]
          ...
       };
     }
   
   updateSeries() {
      if (!this.flag &&  this.option.series.length > 100) { this.flag = true; }
      if(this.flag) { this.option.series.splice(0,2); }
      
      this.option.series.push(this.LinesSeries(), this.PointsSeries());
      this.echartsInstance.setOption({series: this.option.series});
   }
   
   onChartInit(event: any) {
       if (this.alive) {
         this.echartsInstance = event; 
       }
     }


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977270637


   Someone please take a look to this issue. I really need a solution for my 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] echarts-bot[bot] commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-976140817


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](https://echarts.apache.org/api.html) and [chart option](https://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/maillist.html).
   
   Have a nice day! 🍵


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-987465672


   Thanks @pissang for replying. 
   
   I implemented replaceMerged feature to solve my main issue (to improve the performance of the globe and prevent browser crashes). However. by using replaceMerged ,the browser and globe performance is too slow compared to using the setOption and appendData feature.
   
   I think appendData is the best way to handle large amount of data. Can you please help to solve my problem using appendData? Is there a way to remove old data from browser and keep adding new ones using appendData?


-- 
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 issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-983226692


   @eapatel I'm not sure but seems it's because you didn't specify the 'type' of axis. 


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-983221989


   Can anyone please help me to solve this issue?


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-978812974


   Hi @pissang, want to use replaceMerge as suggest but before that I need to upgrade echarts version from v4 to v5 in my project.
   
   I've already finished upgrading the echarts to v5.2.2 in my project but while serving my app in angular, it throws below error. 
   
   ```
   ERROR in ../node_modules/echarts/types/dist/echarts.d.ts:1629:30 - error TS2304: Cannot find name 'Omit'.
   
   1629 declare type SVGPathOption = Omit<PathProps, 'shape' | 'buildPath'>;
                                     ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:2457:39 - error TS2304: Cannot find name 'Omit'.
   
   2457 interface AxisLabelBaseOption extends Omit<TextCommonOption, 'color'> {
                                              ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:3071:54 - error TS2304: Cannot find name 'Omit'.
   
   3071 interface AxisPointerOption extends ComponentOption, Omit<CommonAxisPointerOption, 'type'> {
                                                             ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:3471:37 - error TS2304: Cannot find name 'Omit'.
   
   3471 declare type BarSeriesLabelOption = Omit<SeriesLabelOption, 'position'> & {
                                            ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:6805:35 - error TS2304: Cannot find name 'Omit'.
   
   6805 interface LineLabelOption extends Omit<LabelOption, 'distance' | 'position'> {
                                          ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:7447:7 - error TS2304: Cannot find name 'Omit'.
   
   7447 opt?: Omit<DisplayableProps, 'style'>, rect?: ZRRectLike): SVGPath$1 | ZRImage;
              ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:8647:113 - error TS2304: Cannot find name 'Omit'.
   
   8647 declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<ECBasicOption, 'baseOption' | 'options'> & {
                                                                                                                        ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:8737:16 - error TS2304: Cannot find name 'Omit'.
   
   8737     dayLabel?: Omit<LabelOption, 'position'> & {
                       ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:8760:18 - error TS2304: Cannot find name 'Omit'.
   
   8760     monthLabel?: Omit<LabelOption, 'position'> & {
                         ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:8779:17 - error TS2304: Cannot find name 'Omit'.
   
   8779     yearLabel?: Omit<LabelOption, 'position'> & {
                        ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:8905:39 - error TS2304: Cannot find name 'Omit'.
   
   8905 interface TimelineLabelOption extends Omit<LabelOption, 'position'> {
                                              ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:9477:34 - error TS2304: Cannot find name 'Omit'.
   
   9477 interface PieLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
                                         ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:9506:35 - error TS2304: Cannot find name 'Omit'.
   
   9506 interface PieSeriesOption extends Omit<SeriesOption<PieStateOption<PieCallbackDataParams>, ExtraStateOption>, 'labelLine'>, PieStateOption<PieCallbackDataParams>, CircleLayoutOptionMixin, BoxLayoutOptionMixin, SeriesEncodeOptionMixin {
                                          ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:9914:21 - error TS2304: Cannot find name 'Omit'.
   
   9914         lineStyle?: Omit<LineStyleOption, 'color'> & {
                            ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:9948:34 - error TS2304: Cannot find name 'Omit'.
   
   9948 declare type FunnelLabelOption = Omit<SeriesLabelOption, 'position'> & {
                                         ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:10374:39 - error TS2304: Cannot find name 'Omit'.
   
   10374 interface SunburstLabelOption extends Omit<SeriesLabelOption, 'rotate' | 'position'> {
                                               ~~~~
   ../node_modules/echarts/types/dist/echarts.d.ts:10506:46 - error TS2304: Cannot find name 'Omit'.
   
   10506 interface GraphicComponentTextOption extends Omit<GraphicComponentDisplayableOption, 'textContent' | 'textConfig'> {
   
   ```
   can please guide me what to do to solve 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.

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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977419701


   In my project, I used web socket so once connection established, user can see data until they navigate to another page in the 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 issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977439873


   So you use one series for one data? It's not suggested. But this is required. You can use `replaceMerge` feature which is introduced since 5.0 to remove series.


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-987465672


   Thanks @pissang for the reply.  
   
   I implemented replaceMerged feature to solve my main issue (to improve the performance of the globe and prevent browser crashes). However. by using replaceMerged ,the browser and globe performance is too slow compared to using the setOption and appendData feature.
   
   I think appendData is the best way to handle large amount of data. Can you please help to solve my problem using appendData? Is there a way to remove old data from browser and keep adding new ones using appendData?


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-1004500457


   Hi @pissang, I'm using web socket in my project so it would be hard to produce same situation in demo.
   
   appendData is not supported with 3DLines, so only replaceMerged should be used. With this method, I can't see any performance improvements. Do you think replaceMerged could be useful with web socket where the data volume is large? Or please suggest an alternative solution.


-- 
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 edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977439873


   So you use one series for one data? It's not suggested. But this is required. You can use `replaceMerge` feature which is introduced since 5.0 to remove series.
   
   Check https://echarts.apache.org/zh/api.html#echartsInstance.setOption


-- 
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 issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-994282368


   @eapatel Could you provide a demo? replaceMerged setOption should not be slower than appendData if data amount is not large.


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   Below is my code using setOption.
   ```
    <div style="width:100%; height:100%"
       [options]="option"
       (chartInit)="onChartInit($event)">
   </div>
   ```
   ```
    echartsInstance: any;
    option: EChartOption = {};
   data: any;
    ```
   ```
   constructor() {
             this.setOption();
             
             this.mySerive.getData().subscribe( res => {
                   if (res) {  this.data = res; }      
             });        
             
             if(this.echartsInstance) {
               this.updateSeries();
             }
         }
       });
   }
   ```
   ```
    setOptions() {
       this.option = {
         legend: {        
           selected: this.selectedLegend,
           selected: {},
           selectedMode: 'multiple',        
           type: 'scroll',
           orient: 'vertical',
           right: 23,
           top: 83,
           data: [],
           icon: 'roundRect'       
         },
         globe: {
           globeRadius: 80,
           ...
         },
         series: []
       };
     }
   ```
   ```
    LinesSeries() {
       return {
         type: 'lines3D',
         name: 'data',     
         data: [ 
             [data.SRCLATLON, data.DSTLATLON]   
          ],
          ...
       };
     }
   
     PointsSeries() {
       return {
         type: 'scatter3D',
         name: 'data',
         coordinateSystem: 'globe',          
         data: [
           {
             value: [data.SRCLATLON],
           }, {          
             value: [data.DSTLATLON],
           }
         ]
          ...
       };
     }
   ```
   ```
   updateSeries() {
      if (!this.flag &&  this.option.series.length > 100) { this.flag = true; }
      if(this.flag) { this.option.series.splice(0,2); }
      
      this.option.series.push(this.LinesSeries(), this.PointsSeries());
      this.echartsInstance.setOption({series: this.option.series});
   }
   ```
   ```
   onChartInit(event: any) {
       if (this.alive) {
         this.echartsInstance = event; 
       }
     }
   ```


-- 
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] eapatel commented on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   Below is my code using setOption.
   
   '''
    <div style="width:100%; height:100%"
       [options]="option"
       (chartInit)="onChartInit($event)">
   </div>
   '''
   '''
    echartsInstance: any;
    option: EChartOption = {};
   data: any;
    
   constructor() {
             this.setOption();
             
             this.mySerive.getData().subscribe( res => {
                   if (res) {  this.data = res; }      
             });        
             
             if(this.echartsInstance) {
               this.updateSeries();
             }
         }
       });
   }
   
    setOptions() {
       this.option = {
         legend: {        
           selected: this.selectedLegend,
           selected: {},
           selectedMode: 'multiple',        
           type: 'scroll',
           orient: 'vertical',
           right: 23,
           top: 83,
           data: [],
           icon: 'roundRect'       
         },
         globe: {
           globeRadius: 80,
           ...
         },
         series: []
       };
     }
   
    LinesSeries() {
       return {
         type: 'lines3D',
         name: 'data',     
         data: [ 
             [data.SRCLATLON, data.DSTLATLON]   
          ],
          ...
       };
     }
     PointsSeries() {
       return {
         type: 'scatter3D',
         name: 'data',
         coordinateSystem: 'globe',          
         data: [
           {
             value: [data.SRCLATLON],
           }, {          
             value: [data.DSTLATLON],
           }
         ]
          ...
       };
     }
   
   updateSeries() {
      if (!this.flag &&  this.option.series.length > 100) { this.flag = true; }
      if(this.flag) { this.option.series.splice(0,2); }
      
      this.option.series.push(this.LinesSeries(), this.PointsSeries());
      this.echartsInstance.setOption({series: this.option.series});
   }
   
   onChartInit(event: any) {
       if (this.alive) {
         this.echartsInstance = event; 
       }
     }
   
   '''


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977415394


   Thanks for the response @pissang.
   
   I also used setOptions to update the data and was accumulating only 100 data. For example, when the length of the series reaches 100 then start deleting the first record (e.g. series.data[0]) and adding new record at the end. However, with this concept, browser freezes since from the beginning. 
   
   While with appendData, I can at least see browser gets freeze after certain time say for example after half and hour or so and this is because I'm not finding any way to remove old data.
   
   So I'm looking for a way to delete the old data so that the browser works smoothly. For example when the length of the series reaches 100 then start deleting the first record (e.g. series.data[0]) and add new record at the end. Is it possible to achieve with appendData?


-- 
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] eapatel edited a comment on issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
eapatel edited a comment on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977454238


   will try to use replaceMerge by upgrading echarts with v5 in my 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 issue #16095: appendData crashed the tab after sometimes in 3d globe.

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #16095:
URL: https://github.com/apache/echarts/issues/16095#issuecomment-977385384


   I'm not sure the amount of your data. But keep appending data without removing the old data is not a good idea.  `appendData` is used for streaming data. But we can do nothing if the data increases unlimitedly. It will bring lot's of pressure to the memory and GC. 
   
   Instead you can use `setOption` to update the data. And keep the amount of data under a line(this line can be arbitrary).


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