Skip to content

Commit

Permalink
Resolves TypeError: Cannot read property viewRangeLength of undefined
Browse files Browse the repository at this point in the history
Fixes #104

Signed-off-by: Ankush Tyagi <ankush.tyagi@ericsson.com>
  • Loading branch information
ankusht-work authored and bhufmann committed Feb 11, 2021
1 parent 89eecee commit c30a02c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions timeline-chart/src/layer/time-graph-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class TimeGraphChart extends TimeGraphChartLayer {
protected rowElementMouseInteractions: TimeGraphRowElementMouseInteractions;
protected selectedElementModel: TimelineChart.TimeGraphState;
protected selectedElementChangedHandler: ((el: TimelineChart.TimeGraphState) => void)[] = [];

protected providedRange: TimelineChart.TimeGraphRange;
protected providedResolution: number;

Expand Down Expand Up @@ -172,14 +171,16 @@ export class TimeGraphChart extends TimeGraphChartLayer {
this.maybeFetchNewData();
}
});
if (this.unitController.viewRangeLength) {
if (this.unitController.viewRangeLength && this.stateController.canvasDisplayWidth) {
this.maybeFetchNewData();
}
}

updateChart() {
const update = true;
this.maybeFetchNewData(update);
if (this.unitController && this.stateController) {
this.maybeFetchNewData(update);
}
}

update() {
Expand Down

0 comments on commit c30a02c

Please sign in to comment.