David Pomerenke
commited on
Commit
·
2eeba23
1
Parent(s):
58de179
Fix: sort copy, not in place
Browse files
frontend/src/components/HistoryPlot.js
CHANGED
@@ -3,7 +3,7 @@ import * as Plot from '@observablehq/plot'
|
|
3 |
|
4 |
const HistoryPlot = ({ data }) => {
|
5 |
const containerRef = useRef()
|
6 |
-
const models = data.model_table
|
7 |
.sort((a, b) => new Date(a.creation_date) - new Date(b.creation_date))
|
8 |
.reduce((acc, curr) => {
|
9 |
const last = acc[acc.length - 1]?.maxAverage || 0
|
|
|
3 |
|
4 |
const HistoryPlot = ({ data }) => {
|
5 |
const containerRef = useRef()
|
6 |
+
const models = [...data.model_table] // sort copy, not in place
|
7 |
.sort((a, b) => new Date(a.creation_date) - new Date(b.creation_date))
|
8 |
.reduce((acc, curr) => {
|
9 |
const last = acc[acc.length - 1]?.maxAverage || 0
|