Skip to content

Commit d5fd391

Browse files
Merge branch 'Data-Visualization' of https://github.com/Patribots4738/ScoutingBackend2024 into Data-Visualization
2 parents 50e8b54 + 34e4587 commit d5fd391

File tree

8 files changed

+513
-384
lines changed

8 files changed

+513
-384
lines changed

package-lock.json

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"@testing-library/user-event": "^13.5.0",
1010
"ag-grid-react": "^31.0.1",
1111
"apexcharts": "^3.45.2",
12+
"chroma-js": "^2.4.2",
1213
"firebase": "^10.7.1",
1314
"firebase-admin": "^12.0.0",
1415
"fs": "^0.0.1-security",

src/Data.js

+18-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let teamAverageMap;
2222
let rankingTable;
2323
let rankingsNumData;
2424
let maxMin;
25-
25+
let maxMinOfAverages;
2626
let rawDataMap;
2727
// Use an async function to fetch and process your data
2828
// Working:
@@ -73,11 +73,13 @@ export const fetchDataAndProcess = async () => {
7373
maxMin = getMaxMin(numData);
7474
commentTeamMap = convertTableToMap(commentData);
7575
numTeamMap = convertToTeamMap(numData);
76-
teamAverageMap = getTeamAverageMap();
76+
teamAverageMap = getTeamAverageMap();
77+
console.log(getTeamAverage("4738"));
7778
allData = resortColumnByPoint(convertAllToTableForm(rawData), "Team", 0);
7879
bigTeamMap = convertToTeamMap(allData);
7980
rawDataMap = convertTableToMap(numData);
8081
rankingTable = getRankingTable();
82+
maxMinOfAverages = getMaxMinOfAverages();
8183
// console.log(teamAverageMap.get("1323"));
8284
// console.log(predictTeamScore(
8385
// [
@@ -107,7 +109,8 @@ export const fetchDataAndProcess = async () => {
107109
teamAverageMap: teamAverageMap,
108110
rawDataMap: rawDataMap,
109111
rankingTable: rankingTable,
110-
maxMin: maxMin
112+
maxMin: maxMin,
113+
maxMinOfAverages: maxMinOfAverages
111114
};
112115
};
113116

@@ -230,6 +233,18 @@ function getMaxMin(data) {
230233
return sol;
231234
}
232235

236+
function getMaxMinOfAverages() {
237+
let arr = [];
238+
console.log(teamAverageMap);
239+
let keys = Array.from(teamAverageMap.keys());
240+
console.log(keys);
241+
arr.push(teamAverageMap.get(keys[0])[0]);
242+
for (let i = 0; i < keys.length; i++) {
243+
arr.push(getTeamAverage(keys[i])[1]);
244+
}
245+
console.log(arr);
246+
return getMaxMin(arr);
247+
}
233248

234249

235250

src/Pages/CompareTeams.css

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.bar-chart {
2+
width: 100%;
3+
height: 400;
4+
display: flex;
5+
justify-content: center;
6+
}
7+
18
.search-bar-compare {
29
position: absolute;
310
left: 0;

0 commit comments

Comments
 (0)