Skip to content

Commit 5368a24

Browse files
Revert "Merge branch 'Data-Visualization' of https://github.com/Patribots4738/ScoutingBackend2024 into Data-Visualization"
This reverts commit 93c47bd, reversing changes made to c7656ba.
1 parent 93c47bd commit 5368a24

9 files changed

+132
-226
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,7 +9,6 @@
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",
1312
"firebase": "^10.7.1",
1413
"firebase-admin": "^12.0.0",
1514
"fs": "^0.0.1-security",

src/Pages/CompareTeams.css

+16
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@
5555
flex-direction: column;
5656
}
5757

58+
.match-stats-container {
59+
border: 1px solid var(--lighter-background-color);
60+
width: 100%;
61+
margin-left: 20px;
62+
margin-right: 20px;
63+
max-height: 250px;
64+
margin-top: 5px;
65+
box-shadow: 0px 0px 10px rgb(0, 0, 0);
66+
display: flex; /* turn the container into a flex container */
67+
justify-content: space-around; /* evenly distribute items along the line */
68+
flex-wrap: wrap;
69+
align-items: center; /* center items along the cross-axis */
70+
overflow-y: auto;
71+
margin-bottom: 15px;
72+
}
73+
5874
.match-content-selector {
5975
width: 200px;
6076
display: flex;

src/Pages/CompareTeams.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Compare() {
1515
const [allTeams, setAllTeams] = useState([]);
1616
const [teamData, setTeamData] = useState([]);
1717
const [teamMatchData, setTeamMatchData] = useState([]);
18-
const [maxMinAverages, setMaxMinAverages] = useState({});
18+
const [maxMin, setMaxMin] = useState({});
1919
const [teamColors, setTeamColors] = useState([]);
2020
const [teamList, setTeamList] = useState([]);
2121

@@ -60,7 +60,7 @@ function Compare() {
6060
setAllTeams(getAllTeams(data));
6161
setAverageData(data.teamAverageMap);
6262
setMatchData(data.bigTeamMap);
63-
setMaxMinAverages(data.maxMinOfAverages);
63+
setMaxMin(data.maxMin);
6464
});
6565
}, 1000);
6666
}, []);
@@ -236,23 +236,27 @@ function Compare() {
236236

237237
// selects data points from teamData and formats them for
238238
// the radar chart
239-
const convertForReCharts = () => {
239+
const convertForReCharts = (isBar) => {
240240
let arr = [];
241241
for (let i = 1; i < teamData[0][0].length; i++) {
242242
if (isRadarPoint(teamData[0][0][i])) {
243243
let categoryObj = { key: teamData[0][0][i] };
244244
for (let j = 0; j < teamData.length; j++) {
245-
let min = maxMinAverages.get(teamData[j][0][i])[0];
246-
let max = maxMinAverages.get(teamData[j][0][i])[1];
245+
let min = maxMin.get(teamData[j][0][i])[0];
246+
let max = maxMin.get(teamData[j][0][i])[1];
247247
let val = ((teamData[j][1][i] - min) / (max - min)) * 100;
248-
categoryObj[teamList[j]] = val; // Use team number as key
248+
if (isBar) {
249+
categoryObj[teamList[j]] = teamData[j][1][i];
250+
} else {
251+
categoryObj[teamList[j]] = val;
252+
}
249253
}
250254
arr.push(categoryObj);
251255
}
252256
}
253257
console.log(arr);
254258
return arr;
255-
};
259+
};
256260

257261
const colors = [
258262
'#d4af37',
@@ -283,7 +287,7 @@ function Compare() {
283287
<MyBarChart
284288
width={1000}
285289
height={250}
286-
data={convertForReCharts()}
290+
data={convertForReCharts(true)}
287291
margin={{ top: 5, right: 30, left: 20, bottom: 50 }}
288292
barConfigs={teamList.map(
289293
(team, index) => colorConfig[`team${index + 1}`]
@@ -295,7 +299,7 @@ function Compare() {
295299

296300
<div className="radar-ct">
297301
<RadarGraph
298-
data={convertForReCharts()}
302+
data={convertForReCharts(false)}
299303
angleKey="key"
300304
radiusDomain={[0, 100]}
301305
radars={teamList.slice(0, 10).map((team, index) => ({

src/Pages/Rankings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function Rankings() {
5151
"children": [
5252
{
5353
"name": data.rankingTable[i]["Team"],
54-
"Score": data.rankingTable[i][sortCol]
54+
"Score": data.rankingTable[i]["Score"]
5555
}
5656
]
5757
});

src/Pages/Search.css

+38-32
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,40 @@
1-
.search {
2-
display: flex;
3-
flex-direction: column;
4-
align-items: center;
5-
justify-content: center;
6-
height: 100%;
7-
width: 100%;
8-
background-color: var(--background-color);
9-
color: var(--text-color);
10-
position: relative
1+
.search-bar {
2+
position: absolute;
3+
width: 200px;
4+
left: 0;
5+
right: 0;
6+
top: 60px;
7+
margin-left: auto;
8+
margin-right: auto;
9+
display: inline-flex;
10+
}
11+
12+
.search-input {
13+
position: relative;
14+
width: 70%;
15+
height: 40px;
16+
border-radius: 20px 0px 0px 20px;
17+
border: none;
18+
outline: none;
19+
text-align: center;
20+
font-size: 20px;
21+
}
22+
23+
.search-button {
24+
position: relative;
25+
border: none;
26+
border-radius: 0px 20px 20px 0px;
27+
width: 30%;
28+
background-color: rgb(230, 230, 230);
29+
transition: background-color 0.25s;
30+
}
31+
32+
.search-button:hover {
33+
background-color: rgb(210, 210, 210);
34+
}
35+
36+
.search-button:active {
37+
background-color: rgb(190, 190, 190);
1138
}
1239

1340
.team-stats {
@@ -23,33 +50,12 @@
2350
flex-direction: column;
2451
}
2552

26-
.average-stats-container {
27-
border: 1px solid var(--lighter-background-color);
28-
width: 100%;
29-
margin-left: 20px;
30-
margin-right: 20px;
31-
max-height: 400px;
32-
margin-top: 5px;
33-
padding: 0;
34-
box-shadow: 0px 0px 10px rgb(0, 0, 0);
35-
justify-content: space-around; /* evenly distribute items along the line */
36-
flex-wrap: wrap;
37-
transition: border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out; /* animate border and shadow changes */
38-
left: 0;
39-
right: 0;
40-
margin-left: auto;
41-
margin-right: auto;
42-
overflow: auto;
43-
padding: 0px;
44-
}
45-
4653
.match-stats-container {
4754
border: 1px solid var(--lighter-background-color);
4855
width: 100%;
4956
margin-left: 20px;
5057
margin-right: 20px;
51-
max-height: 250px;
52-
margin-top: 5px;
58+
max-height: 280px;
5359
padding: 0;
5460
box-shadow: 0px 0px 10px rgb(0, 0, 0);
5561
justify-content: space-around; /* evenly distribute items along the line */

0 commit comments

Comments
 (0)