Skip to content

Commit 0e6beb1

Browse files
(updated) getSnapshotIDs algo for readability
1 parent 4ea61ac commit 0e6beb1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/app/components/PerformanceVisx.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Grid } from "@visx/grid";
66
import { AxisBottom } from "@visx/axis";
77
import { scaleBand, scaleLinear, scaleOrdinal } from "@visx/scale";
88
import { useTooltip, useTooltipInPortal, defaultStyles } from "@visx/tooltip";
9-
import { LegendOrdinal } from "@visx/legend";
9+
// import { LegendOrdinal } from "@visx/legend";
10+
import { schemeSet1 } from "d3-scale-chromatic";
1011
// import snapshots from "./snapshots";
1112

1213

@@ -48,9 +49,9 @@ const tooltipStyles = {
4849
};
4950

5051
/* DATA PREP FUNCTIONS */
51-
const getPerfMetrics = snapshots => {
52+
const getPerfMetrics = (snapshots, snapshotsIds) => {
5253
return snapshots.reduce((perfSnapshots, curSnapshot,idx)=> {
53-
return perfSnapshots.concat(traverse(curSnapshot, {snapshot:++idx}))
54+
return perfSnapshots.concat(traverse(curSnapshot, {snapshotId:snapshotsIds[idx]}))
5455
}, [])
5556
}
5657

0 commit comments

Comments
 (0)