Skip to content

Commit 03f94e1

Browse files
committed
Enforce pointsSaved
1 parent 4129e58 commit 03f94e1

File tree

1 file changed

+9
-0
lines changed
  • openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components

1 file changed

+9
-0
lines changed

openc3-cosmos-init/plugins/packages/openc3-vue-common/src/components/Graph.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,6 +1784,15 @@ export default {
17841784
}
17851785
}
17861786
}
1787+
1788+
// Enforce pointsSaved limit - remove oldest data points if exceeded
1789+
if (this.pointsSaved > 0 && this.data[0].length > this.pointsSaved) {
1790+
const pointsToRemove = this.data[0].length - this.pointsSaved
1791+
for (let j = 0; j < this.data.length; j++) {
1792+
this.data[j].splice(0, pointsToRemove)
1793+
}
1794+
}
1795+
17871796
// If we weren't passed a startTime notify grapher of our start
17881797
if (this.startTime == null && this.data[0][0]) {
17891798
let newStartTime = this.data[0][0] * 1_000_000_000

0 commit comments

Comments
 (0)