fix missing graphData culling behavior
This commit is contained in:
parent
7fd0117f74
commit
a68e4d2460
@ -35,6 +35,21 @@ export class GraphDisplayManager {
|
|||||||
this._graphData[i].push(playerCounts[i])
|
this._graphData[i].push(playerCounts[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trim all data arrays to only the relevant portion
|
||||||
|
// This keeps it in sync with backend data structures
|
||||||
|
const graphMaxLength = this._app.publicConfig.graphMaxLength
|
||||||
|
|
||||||
|
if (this._graphTimestamps.length > graphMaxLength) {
|
||||||
|
this._graphTimestamps.splice(0, this._graphTimestamps.length - graphMaxLength)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const series of this._graphData) {
|
||||||
|
if (series.length > graphMaxLength) {
|
||||||
|
series.splice(0, series.length - graphMaxLength)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Paint updated data structure
|
||||||
this._plotInstance.setData([
|
this._plotInstance.setData([
|
||||||
this._graphTimestamps,
|
this._graphTimestamps,
|
||||||
...this._graphData
|
...this._graphData
|
||||||
|
@ -58,7 +58,7 @@ class TimeTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getMaxGraphDataLength () {
|
static getMaxGraphDataLength () {
|
||||||
return Math.ceil(config.graphDuration / config.rates.pingAll)
|
return Math.ceil(config.graphDuration / GRAPH_UPDATE_TIME_GAP)
|
||||||
}
|
}
|
||||||
|
|
||||||
static everyN (array, start, diff, adapter) {
|
static everyN (array, start, diff, adapter) {
|
||||||
|
Loading…
Reference in New Issue
Block a user