mirror of
https://github.com/nasa/openmct.git
synced 2024-12-18 20:57:53 +00:00
Fix logic to purge points less than 1000.
This commit is contained in:
parent
a537b3bf6e
commit
538216b5fe
@ -507,8 +507,12 @@ export default class PlotSeries extends Model {
|
||||
const pointsToRemove = startIndex + (data.length - endIndex + 1);
|
||||
if (pointsToRemove > 0) {
|
||||
if (pointsToRemove < 1000) {
|
||||
// Remove all points up to the start index
|
||||
data.slice(0, startIndex).forEach(this.remove, this);
|
||||
data.slice(endIndex, data.length).forEach(this.remove, this);
|
||||
// Re-calculate the endIndex since the data array has changed,
|
||||
// then remove items from endIndex to the end of the array
|
||||
const newEndIndex = endIndex - startIndex + 1;
|
||||
data.slice(newEndIndex, data.length).forEach(this.remove, this);
|
||||
this.updateSeriesData(data);
|
||||
this.resetStats();
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user