in modules/frontend/app/components/ignite-chart/controller.js [96:131]
async $onChanges(changes) {
if (this.chart && _.get(changes, 'refreshRate.currentValue'))
this.onRefreshRateChanged(_.get(changes, 'refreshRate.currentValue'));
if ((changes.chartDataPoint && _.isNil(changes.chartDataPoint.currentValue)) ||
(changes.chartHistory && _.isEmpty(changes.chartHistory.currentValue))) {
this.clearDatasets();
this.localHistory = [];
return;
}
if (changes.chartHistory && changes.chartHistory.currentValue && changes.chartHistory.currentValue.length !== changes.chartHistory.previousValue.length) {
if (!this.chart)
await this.initChart();
this.clearDatasets();
this.localHistory = [...changes.chartHistory.currentValue];
this.newPoints.splice(0, this.newPoints.length, ...changes.chartHistory.currentValue);
this._refresh();
return;
}
if (this.chartDataPoint && changes.chartDataPoint) {
if (!this.chart)
this.initChart();
this.newPoints.push(this.chartDataPoint);
this.localHistory.push(this.chartDataPoint);
this._refresh();
}
}