fix: retain the last out-of-bounds state (#961)

This re-insures the logic to keep the last known state before the start of our grah interval within the history.
While this is not really correct, it allows for rendering steady-state-graphs.

This element was mistakenly removed in #881.

The piece of code relies on history being chronographical.

fixes #960
This commit is contained in:
akloeckner
2023-04-27 20:13:34 +02:00
committed by GitHub
parent 18fbf4d5ec
commit 8ebe173b83

View File

@@ -70,6 +70,8 @@ export default class Graph {
const key = Math.floor(Math.abs(interval));
if (!res[key]) res[key] = [];
res[key].push(item);
} else {
res[0] = [item];
}
return res;
}