From 3c802b460523d1676a319c80a6399b67e163e5e7 Mon Sep 17 00:00:00 2001 From: Junwon Choi <56373973+cjunwon@users.noreply.github.com> Date: Tue, 23 Apr 2024 10:21:28 -0700 Subject: [PATCH] Data sports (#203) * Sports Request - Swimmers * changes to sports-swimming * changed m to yards * Sports swimming request editor upload * backstroke/illinois * changed record times * Final --------- Co-authored-by: ayukadakia --- collaborations/sports-swimming-2024/IM.html | 79 +++++ collaborations/sports-swimming-2024/IM.js | 292 ++++++++++++++++++ .../sports-swimming-2024/backstroke.html | 68 ++++ .../sports-swimming-2024/backstroke.js | 104 +++++++ .../sports-swimming-2024/breaststroke.html | 82 +++++ .../sports-swimming-2024/breaststroke.js | 240 ++++++++++++++ .../sports-swimming-2024/icons8-star-48.png | Bin 0 -> 801 bytes .../sports-swimming-2024/styles.css | 10 + 8 files changed, 875 insertions(+) create mode 100644 collaborations/sports-swimming-2024/IM.html create mode 100644 collaborations/sports-swimming-2024/IM.js create mode 100644 collaborations/sports-swimming-2024/backstroke.html create mode 100644 collaborations/sports-swimming-2024/backstroke.js create mode 100644 collaborations/sports-swimming-2024/breaststroke.html create mode 100644 collaborations/sports-swimming-2024/breaststroke.js create mode 100644 collaborations/sports-swimming-2024/icons8-star-48.png create mode 100644 collaborations/sports-swimming-2024/styles.css diff --git a/collaborations/sports-swimming-2024/IM.html b/collaborations/sports-swimming-2024/IM.html new file mode 100644 index 00000000..51c05a88 --- /dev/null +++ b/collaborations/sports-swimming-2024/IM.html @@ -0,0 +1,79 @@ + + + + + chart.js + + + + + + +
+ +
+ + + + +
+ +
+ + + + + + \ No newline at end of file diff --git a/collaborations/sports-swimming-2024/IM.js b/collaborations/sports-swimming-2024/IM.js new file mode 100644 index 00000000..bccd08b6 --- /dev/null +++ b/collaborations/sports-swimming-2024/IM.js @@ -0,0 +1,292 @@ +Chart.defaults.font.family = 'PT Sans'; +const ctxt2 = document.getElementById('sportGraph2'); +const pointImage = new Image(25, 25); +pointImage.src = 'icons8-star-48.png'; +const costGraph2 = new Chart(ctxt2, { + type: 'line', + data: { + labels: [ + 'Fresno State Invite', + 'Washington State Dual Meet', + 'UC Santa Barbara Dual Meet', + 'Illinois Dual Meet', + 'Arizona State Dual Meet', + 'Arizona Dual Meet', + 'Art Adamson Invitational', + 'UC San Diego-Wisconsin Tri-Meet', + 'Utah Dual Meet', + 'Stanford Dual Meet', + 'California Dual Meet', + 'USC Dual Meet', + 'Pac-12 Championship Preliminary Round', + 'Pac-12 Championship Finals', + 'NCAA Preliminary Round', + 'NCAA Finals', + ], + datasets: [ + { + label: 'Rosie Murphy', + data: [ + 124.38, + null, + 123.55, + 123.55, + 121.92, + null, + 117.93, + 123.34, + 122.95, + null, + 121.64, + 117.45, + 115.93, + 116.41, + 116.32, + null, + ], + backgroundColor: ['#191970'], + borderColor: ['#191970'], + spanGaps: true, + pointStyle: [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + 'circle', + ], + }, + { + label: 'Paige MacEachern', + data: [ + null, + null, + 123.66, + null, + 119.53, + null, + 117.2, + 122.99, + 122.71, + null, + 124.01, + 119.27, + 115.97, + 116.29, + 118.16, + null, + ], + backgroundColor: ['#F07857'], + borderColor: ['#F07857'], + spanGaps: true, + pointStyle: [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + 'circle', + ], + }, + { + label: 'School Record-Breaking Times', + backgroundColor: ['#939033'], + borderColor: ['#939033'], + }, + ], + }, + options: { + scales: { + y: { + min: 115, + title: { + display: true, + text: 'Time in Seconds', + }, + }, + }, + plugins: { + legend: { + display: true, + title: { + display: true, + text: ['UCLA Swimmers', 'IM'], + padding: 20, + font: { + size: 20, + }, + }, + }, + }, + }, +}); +const selectElement = document.querySelector('select'); +selectElement.addEventListener('change', changeGraph); +function changeGraph() { + if (selectElement.value === 'sportGraph2') { + costGraph2.data.datasets[0].data = [ + 262.52, + 264.46, + null, + null, + null, + 255.93, + 250.67, + null, + null, + 257.03, + null, + null, + 248.88, + 246.0, + 246.23, + 245.01, + ]; + costGraph2.data.datasets[1].data = [ + 261.04, + null, + null, + null, + null, + 253.92, + 246.15, + null, + null, + 259.71, + null, + null, + 248.47, + 243.47, + 245.38, + 248.95, + ]; + costGraph2.options.scales.y.min = 242; + costGraph2.data.datasets[0].pointStyle = [ + [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + ], + ]; + costGraph2.data.datasets[1].pointStyle = [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + ]; + } else { + costGraph2.data.datasets[0].data = [ + 124.38, + null, + 123.55, + 123.55, + 121.92, + null, + 117.93, + 123.34, + 122.95, + null, + 121.64, + 117.45, + 115.93, + 116.41, + 116.32, + null, + ]; + costGraph2.data.datasets[1].data = [ + null, + null, + 123.66, + null, + 119.53, + null, + 117.2, + 122.99, + 122.71, + null, + 124.01, + 119.27, + 115.97, + 116.29, + 118.16, + null, + ]; + costGraph2.options.scales.y.min = 115; + costGraph2.data.datasets[0].pointStyle = [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + 'circle', + ]; + costGraph2.data.datasets[1].pointStyle = [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + 'circle', + ]; + } + costGraph2.update(); +} diff --git a/collaborations/sports-swimming-2024/backstroke.html b/collaborations/sports-swimming-2024/backstroke.html new file mode 100644 index 00000000..2c7fe907 --- /dev/null +++ b/collaborations/sports-swimming-2024/backstroke.html @@ -0,0 +1,68 @@ + + + + + chart.js + + + + + + + +
+ +
+ + + + + + \ No newline at end of file diff --git a/collaborations/sports-swimming-2024/backstroke.js b/collaborations/sports-swimming-2024/backstroke.js new file mode 100644 index 00000000..1c851297 --- /dev/null +++ b/collaborations/sports-swimming-2024/backstroke.js @@ -0,0 +1,104 @@ +Chart.defaults.font.family = 'PT Sans'; +const ctxt = document.getElementById('sportGraph3'); +const pointImage = new Image(25, 25); +pointImage.src = 'icons8-star-48.png'; +const costGraph = new Chart(ctxt, { + type: 'line', + data: { + labels: [ + 'Fresno State Invite', + 'Washington State Dual Meet', + 'UC Santa Barbara Dual Meet', + 'Illinois Dual Meet', + 'Arizona State Dual Meet', + 'Arizona Dual Meet', + 'Art Adamson Invitational', + 'UC San Diego-Wisconsin Tri-Meet', + 'Utah Dual Meet', + 'Stanford Dual Meet', + 'California Dual Meet', + 'USC Dual Meet', + 'Pac-12 Championship Preliminary Round', + 'Pac-12 Championship Finals', + 'NCAA Preliminary Round', + ], + datasets: [ + { + label: 'Rosie Murphy', + data: [ + 121.36, + 119.66, + 120.2, + null, + 116.19, + 117.03, + 115.78, + null, + 117.93, + null, + 117.92, + 113.25, + 113.45, + 113.13, + 113.83, + null, + ], + backgroundColor: ['#00b4d8'], + borderColor: ['#00b4d8'], + spanGaps: true, + pointStyle: [ + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + 'circle', + pointImage, + 'circle', + pointImage, + 'circle', + ], + }, + { + label: 'School Record-Breaking Times', + backgroundColor: ['#939033'], + borderColor: ['#939033'], + }, + ], + }, + options: { + categoryPercentage: 0.7, + barPercentage: 1, + + scales: { + x: { + ticks: {}, + }, + y: { + min: 112, + title: { + display: true, + text: 'Time in Seconds', + }, + }, + }, + plugins: { + legend: { + display: true, + title: { + display: true, + text: ['UCLA Swimmers', 'Backstroke'], + padding: 20, + font: { + size: 20, + }, + }, + }, + }, + }, +}); diff --git a/collaborations/sports-swimming-2024/breaststroke.html b/collaborations/sports-swimming-2024/breaststroke.html new file mode 100644 index 00000000..282efaa9 --- /dev/null +++ b/collaborations/sports-swimming-2024/breaststroke.html @@ -0,0 +1,82 @@ + + + + + chart.js + + + + + + +
+ +
+ +
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/collaborations/sports-swimming-2024/breaststroke.js b/collaborations/sports-swimming-2024/breaststroke.js new file mode 100644 index 00000000..401ea77e --- /dev/null +++ b/collaborations/sports-swimming-2024/breaststroke.js @@ -0,0 +1,240 @@ +Chart.defaults.font.family = 'PT Sans'; +const ctxt = document.getElementById('sportGraph'); +const costGraph = new Chart(ctxt, { + type: 'line', + data: { + labels: [ + 'Fresno State Invite', + 'Washington State Dual Meet', + 'UC Santa Barbara Dual Meet', + 'Illinois Dual Meet', + 'Arizona State Dual Meet', + 'Arizona Dual Meet', + 'Art Adamson Invitational', + 'UC San Diego-Wisconsin Tri-Meet', + 'Utah Dual Meet', + 'Stanford Dual Meet', + 'California Dual Meet', + 'USC Dual Meet', + 'Pac-12 Championship Preliminary Round', + 'Pac-12 Championship Finals', + 'NCAA Preliminary Round', + ], + datasets: [ + { + label: 'Ana Jih-Schiff', + data: [ + 62.35, + 62.91, + 62.19, + null, + 60.84, + 60.43, + 61.09, + 61.8, + null, + 62.11, + null, + 60.17, + 61.15, + 61.49, + null, + ], + backgroundColor: ['#eb6762'], + borderColor: ['#eb6762'], + spanGaps: true, + }, + { + label: 'Sarah Bennetts', + data: [ + 62.19, + 63.92, + null, + null, + 60.09, + 60.67, + 61.26, + 63.04, + 63.01, + 62.38, + 62.52, + 60.46, + 60.76, + 60.31, + null, + ], + backgroundColor: ['#AED6F1'], + borderColor: ['#AED6F1'], + spanGaps: true, + }, + { + label: 'Eva Carlson', + data: [ + 62.53, + 63.85, + null, + 62.32, + 60.84, + 60.84, + 60.66, + null, + 63.71, + 62.09, + 62.72, + 60.6, + 59.78, + 59.62, + 60.31, + ], + backgroundColor: ['#939033'], + borderColor: ['#939033'], + spanGaps: true, + }, + ], + }, + options: { + categoryPercentage: 0.7, + barPercentage: 1, + + scales: { + x: { + ticks: {}, + }, + y: { + min: 59, + title: { + display: true, + text: 'Time in Seconds', + }, + }, + }, + plugins: { + legend: { + display: true, + title: { + display: true, + text: ['UCLA Swimmers', 'Breaststroke'], + padding: 20, + font: { + size: 20, + }, + }, + }, + }, + }, +}); +const selectElement = document.querySelector('select'); +selectElement.addEventListener('change', changeGraph); +function changeGraph() { + if (selectElement.value === 'sportGraph2') { + costGraph.data.datasets[0].data = [ + 135.38, + 135.71, + null, + null, + 130.45, + 131.78, + 132.38, + null, + 134.24, + null, + 134.6, + 129.81, + 131.87, + 132.67, + null, + null, + ]; + costGraph.data.datasets[1].data = [ + 138.29, + 139.94, + 136.52, + null, + 132.41, + 134.29, + 132.33, + null, + null, + null, + 135.16, + 132.11, + 133.36, + 131.36, + null, + null, + ]; + costGraph.data.datasets[2].data = [ + 140.39, + 138.37, + null, + null, + 133.73, + 134.86, + 132.76, + null, + 139.37, + null, + 139.71, + 132.69, + 131.61, + 131.01, + 131.37, + null, + ]; + costGraph.options.scales.y.min = 128; + } else { + costGraph.data.datasets[0].data = [ + 62.35, + 62.91, + 62.19, + null, + 60.84, + 60.43, + 61.09, + 61.8, + null, + 62.11, + null, + 60.17, + 61.15, + 61.49, + null, + ]; + costGraph.data.datasets[1].data = [ + 62.19, + 63.92, + null, + null, + 60.09, + 60.67, + 61.26, + 63.04, + 63.01, + 62.38, + 62.52, + 60.46, + 60.76, + 60.31, + null, + ]; + costGraph.data.datasets[2].data = [ + 62.53, + 63.85, + null, + 62.32, + 60.84, + 60.84, + 60.66, + null, + 63.71, + 62.09, + 62.72, + 60.6, + 59.78, + 59.62, + 60.31, + ]; + costGraph.options.scales.y.min = 59; + } + costGraph.update(); +} diff --git a/collaborations/sports-swimming-2024/icons8-star-48.png b/collaborations/sports-swimming-2024/icons8-star-48.png new file mode 100644 index 0000000000000000000000000000000000000000..085aa25c51c0855492d0517922d2e073e4837277 GIT binary patch literal 801 zcmV++1K#|JP)C52TZ3y8J}A6WdVdUrjy|N zNv|6Hs^vMEGMxfpm=2O(&H_9(oq!yr604(MDWgSuFHGDagb!Df57+|}XXLV}lghZT zo&cMLJbQg6u29BONc5{Brc4~+`-z^g=m%^;GuUh51|gV?K)zxyVd8{5c_$)9|8EwU zlc(B3wlLOrK(csF2ren%jY{2rsDpgf>@y|n!}_v5t?%ZLEcEWP?`&lpR>EsSSX72L z!uX{DqIH=Nd{@G^R-7=5s1H{qn>=60CXfD;xG>&ShB?A|GCpcISzTLN&&J1xc1F4b#UgGKg8T6yk2AJ9Og$)-hPMd8 z-58LcvH`7&d{Bfkj<-($Or+C8Tg^tWv}86ZVZP<$3GSrRX7h%~uMolLx3FxAO(VZT z1VPq0dB%c0%eaCvTz44xF%!SeGb(wQG_8U%+;fnDQtJc|zIRaj?^;5BxnF|$=4Sxr z>;AWGbZz475=)}rxd37BqALM@7A`m!poF)aWq?C^{iX?UI4=mpw0i*rvyli9e6-_W z+3fFV&&)a{pUd^^uC@1E5k-Q}c8(5CPURtKS;(jGXK`_K^z0sY0tg2~4*zP0@Zt#W z4GTbdNf5Fe5SJfAgz-v^Lx0-tk$Lc7R6nYz{pF1V!?!hWB1&F%CLq|23gIt1v55>E zY1H5CO#h*Bn@;#6aFH{{6@=h*t>qTX*00000NkvXXu0mjfuv2w0 literal 0 HcmV?d00001 diff --git a/collaborations/sports-swimming-2024/styles.css b/collaborations/sports-swimming-2024/styles.css new file mode 100644 index 00000000..6b564a5d --- /dev/null +++ b/collaborations/sports-swimming-2024/styles.css @@ -0,0 +1,10 @@ +h1 { + text-align: center; +} + +body { + width: 600px; + height: 600px; + margin: auto; + margin-top: 50px; +} \ No newline at end of file