From dc7f314298bdf77ebaf3f91367d504cee3f70a5d Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Sun, 4 Aug 2024 13:37:15 -0700 Subject: [PATCH] add key --- src/components/snake/index.tsx | 24 ++++++++++++++++++------ src/favicon.png | Bin 599 -> 1023 bytes 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/snake/index.tsx b/src/components/snake/index.tsx index 899461f..313ec95 100644 --- a/src/components/snake/index.tsx +++ b/src/components/snake/index.tsx @@ -13,9 +13,9 @@ function tableHead(...cols: (string | number)[]) { const elements = cols.map((col, idx) => {col}); return {elements}; } -function tableRow(...cols: (string | number)[]) { +function tableRow(key: number, ...cols: (string | number)[]) { const elements = cols.map((col, idx) => {col}); - return {elements}; + return {elements}; } const SnakePage: FC = () => { @@ -46,7 +46,7 @@ const SnakePage: FC = () => { const labSnapsTRs = useMemo( () => - snaps.map(snap => { + snaps.map((snap, idx) => { const labsRanked = snap.labs.sort((a, b) => a.snakeLength - b.snakeLength); const avgLen = labsRanked.reduce((prev, curr) => prev + curr.snakeLength, 0) / labsRanked.length; @@ -59,7 +59,19 @@ const SnakePage: FC = () => { const q95Len = labsRanked[Math.floor(labsRanked.length * 0.95)]!.snakeLength; const maxLen = Math.max(...labsRanked.map(lab => lab.snakeLength)); - return tableRow(snap.iteration, avgLen, minLen, q20Len, q40Len, q60Len, q80Len, q90Len, q95Len, maxLen); + return tableRow( + idx, + snap.iteration, + avgLen, + minLen, + q20Len, + q40Len, + q60Len, + q80Len, + q90Len, + q95Len, + maxLen, + ); }), [snaps], ); @@ -70,8 +82,8 @@ const SnakePage: FC = () => {
- {tableHead('Itr', 'Avg', 'Min', '20%', '40%', '60%', '80%', '90%', '95%', 'Max')} - {labSnapsTRs} + {tableHead('Itr', 'Avg', 'Min', '20%', '40%', '60%', '80%', '90%', '95%', 'Max')} + {labSnapsTRs}
diff --git a/src/favicon.png b/src/favicon.png index f541a38db945d9b5526f87535e049041f6313a12..96470a9478d16219028b2d6ee5d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