mirror of
https://github.com/kalkih/mini-graph-card.git
synced 2025-12-20 00:35:56 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user