Skip to content

Commit c7656ba

Browse files
committed
you got that
1 parent e9dd19a commit c7656ba

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/Data.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export const fetchDataAndProcess = async () => {
7474
commentTeamMap = convertTableToMap(commentData);
7575
numTeamMap = convertToTeamMap(numData);
7676
teamAverageMap = getTeamAverageMap();
77-
console.log(getTeamAverage("4738"));
7877
allData = resortColumnByPoint(convertAllToTableForm(rawData), "Team", 0);
7978
bigTeamMap = convertToTeamMap(allData);
79+
console.log(bigTeamMap);
8080
rawDataMap = convertTableToMap(numData);
8181
rankingTable = getRankingTable();
8282
maxMinOfAverages = getMaxMinOfAverages();
@@ -265,7 +265,7 @@ function resortColumn(data, columnInitial, columnGoal) {
265265
}
266266

267267
// Working but EXTREMELY INEFFICIENT?
268-
function resortColumnsByArray(data, orderArr) {
268+
export function resortColumnsByArray(data, orderArr) {
269269
console.log(data);
270270
let newData = [...data];
271271
for (let i = 0; i < orderArr.length; i++) {

src/Pages/Search.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
33
import {fetchDataAndProcess} from '../Data.js';
44
import { getMaxMin } from '../Data.js';
55
import RadarGraph from "../widgets/RadarGraphSearch.js";
6+
import {resortColumnsByArray} from "../Data.js";
67
import "./Search.css";
78
import "./Tables.css";
89

@@ -117,10 +118,17 @@ function Search() {
117118
// returns the section of the match data to display based on if the current data
118119
// type is either numbers or comments
119120
const matchContent = (matches) => {
121+
console.log(matches);
120122
if (matchDataType === "num") {
121-
return matches.slice(commentLength);
123+
return resortColumnsByArray(matches.slice(commentLength),
124+
[
125+
126+
] );
122127
}
123-
return matches.slice(1, commentLength);
128+
return resortColumnsByArray(matches.slice(1, commentLength),
129+
[
130+
131+
]);
124132
}
125133

126134
// changes match data type to either num or comment

0 commit comments

Comments
 (0)