FERNman / angular-google-charts

A wrapper for the Google Charts library written in Angular.
Other
273 stars 107 forks source link

Memory leak / infinite loop leading web page to hang then crash #268

Closed SDAdham closed 2 years ago

SDAdham commented 2 years ago

Bug Report

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

Description

A clear and concise description of what the bug is. For some reason that the chart causes the web page to freeze and crash (it's like it's running in infinite loop).

To reproduce

Here is the properties given:

<google-chart
      [title]="chartName"
      [type]="chartType"
      [data]="chartData"
      [columns]="chartColumns"
      [options]="chartOptions"
      [dynamicResize]="true"
      (error)="onError($event)"
      (ready)="chartReady($event)"
      style="width: 100%"
    >
    </google-chart>

chartType: LineChart chartData (tested with 2 scenarios): Scenario one:

[
  [
    {"v":"06/11/2021"},
    {"v":3}
  ],
  [
    {"v":"10/11/2021"},
    {"v":4}
  ],
  [
    {"v":"27/12/2021"},
    {"v":5}
  ],
  [
   {"v":"28/12/2021"},
   {"v":6}
  ],
  [
    {"v":"28/12/2021"},
    {"v":7}
  ]
]

Scenario Two:

[
  ["06/11/2021", 3],
  ... // same data as before
]

chartOptions:

{
    animation: {
      duration: 250,
      easing: 'ease-in-out',
      startup: true,
    },
    allowHtml: true,
  };

chartColumns (tested with 2 scenarios): Scenario one:

[{"id":"newCol0","label":"Date","type":"date"},{"id":"newCol1","label":"Company","type":"number"}]

Scenario Two:

['Date', 'Company']

Steps to reproduce the behaviour:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour

A clear and concise description of what you expected to happen. Shouldn't go into memory leak

Exception or Error





Your environment



Angular CLI: 13.1.4
Node: 14.15.3
Package Manager: yarn 3.2.0
OS: linux x64

Angular: 13.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.0
@angular-devkit/build-angular   13.3.0
@angular-devkit/core            13.3.0
@angular-devkit/schematics      13.3.0
@angular/cdk                    13.3.1
@angular/cli                    13.1.4
@angular/language-service       13.3.0
@angular/localize               13.3.0
@angular/platform-server        13.3.0
@angular/service-worker         13.3.0
@nguniversal/builders           12.1.3
@nguniversal/express-engine     12.1.3
@schematics/angular             13.1.4
rxjs                            7.5.5
typescript                      4.5.5
webpack                         5.70.0

Anything else?

Add any other context about the problem here.

SDAdham commented 2 years ago

It was a problem in my code, figured it out. Sorry about this.