Skip to content

Commit 8cea6b7

Browse files
committed
fixed it?
1 parent 90b9e2f commit 8cea6b7

10 files changed

Lines changed: 53 additions & 42 deletions

File tree

Mainpages/dataPages/airQuality.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About us</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>

Mainpages/dataPages/birthData.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>
@@ -58,7 +58,7 @@ <h1>Welcome to the Birth Data visualization Page!</h1>
5858
<script>
5959
const BirthChartTotalData = '/Datasets/birthCount-Eng+Wales_1938-2024.csv';
6060
d3.csv(BirthChartTotalData).then(function (datapoints) {
61-
61+
// make variables then push data into them
6262
const birthYear= [];
6363
const birthCount = [];
6464

@@ -67,7 +67,7 @@ <h1>Welcome to the Birth Data visualization Page!</h1>
6767
birthCount.push(datapoints[i]['Number of Live Births'])
6868
};
6969

70-
70+
// prep the data for the chart
7171
const birthDataTotal = {
7272
labels: birthYear,
7373
datasets: [{
@@ -78,6 +78,7 @@ <h1>Welcome to the Birth Data visualization Page!</h1>
7878
tension: 0.1,
7979
}]
8080
}
81+
// draw chart
8182
const deathRateTotal = new Chart(birthTot, {
8283
type: 'line',
8384
data: birthDataTotal,
@@ -101,8 +102,12 @@ <h1>Welcome to the Birth Data visualization Page!</h1>
101102

102103

103104
})
105+
// get element ID for drawing chart
104106
const birthTot = document.getElementById('birthRateTotal');
105107

108+
// the next chart made is a bar chart
109+
// this chart goes into the negatives which is handled natively by chart.js
110+
// used to show off more functionality of the site, and the library used
106111
const fertilityData = '/Datasets/Age_specific_fertility_rate_mother+father_2024+2023.csv';
107112
d3.csv(fertilityData).then(function (datapoints){
108113
const ageGroup = [];

Mainpages/dataPages/deathData.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About us</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>
@@ -76,6 +76,7 @@ <h1>Welcome to the Death Data visualization Page!</h1>
7676
<script>
7777
const DeathChartTotalData = '/Datasets/Deaths-Gender-Eng-Wal-1992-2024.csv'
7878
d3.csv(DeathChartTotalData).then(function (datapoints) {
79+
// Prep the variables and then push data into them.
7980
const totalDeaths = [];
8081
const deathYear = [];
8182
const maleDeaths = [];
@@ -88,7 +89,7 @@ <h1>Welcome to the Death Data visualization Page!</h1>
8889
femaleDeaths.push(datapoints[i]['Females'])
8990
};
9091

91-
92+
// prep the data for our chart
9293
const deathDataTotal = {
9394
labels: deathYear,
9495
datasets: [{
@@ -99,6 +100,7 @@ <h1>Welcome to the Death Data visualization Page!</h1>
99100
tension: 0.1,
100101
}]
101102
}
103+
// draw the chart
102104
const deathRateTotal = new Chart(deathTot, {
103105
type: 'line',
104106
data: deathDataTotal,
@@ -200,12 +202,13 @@ <h1>Welcome to the Death Data visualization Page!</h1>
200202
maleDeaths.push(datapoints[i].Males)
201203
femaleDeaths.push(datapoints[i].Females)
202204
}
203-
console.log(region)
204-
console.log(maleDeaths)
205-
console.log(femaleDeaths)
205+
// **previously had an error with this section, uncomment if logs are needed.
206+
//console.log(region)
207+
//console.log(maleDeaths)
208+
//console.log(femaleDeaths)
206209
const regionLabels = region;
207210
const deathRegionData = {
208-
211+
// two datasets are needed as the graph used requires two bars, chart.js provides this natively.
209212
labels: regionLabels,
210213
datasets: [{
211214
label: 'Male Deaths',
@@ -230,7 +233,7 @@ <h1>Welcome to the Death Data visualization Page!</h1>
230233
borderWidth: 1
231234
}]
232235
};
233-
236+
// dual bar-chart instead of line chart
234237
const deathRateRegionChart = new Chart(deathReg, {
235238
type: 'bar',
236239
data: deathRegionData,
@@ -254,6 +257,7 @@ <h1>Welcome to the Death Data visualization Page!</h1>
254257
})
255258

256259
})
260+
// get elementID for drawing chart.
257261
const deathReg = document.getElementById('deathByRegion');
258262

259263
</script>

Mainpages/dataPages/financeData.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>
@@ -55,7 +55,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
5555
<script>
5656
const totalImportExportData = '/Datasets/total-uk-imports-exports.csv';
5757
d3.csv(totalImportExportData).then(function (datapoints){
58-
58+
// Prepare the constants needed for the graphs. Then, push the values from our CSV into them.
5959
const year = [];
6060
const imports = [];
6161
const exports = [];
@@ -64,7 +64,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
6464
imports.push(datapoints[i]['imports-billions'])
6565
exports.push(datapoints[i]['exports-billions'])
6666
}
67-
67+
// prepare import data
6868
const totalImportData = {
6969
labels: year,
7070
datasets:[{
@@ -75,7 +75,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
7575
tension: 0.0,
7676
}]
7777
}
78-
78+
// Draw the Import Chart
7979
const totalImportChart = new Chart(importTot, {
8080
type: 'line',
8181
data: totalImportData,
@@ -97,7 +97,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
9797
pointRadius: 3,
9898
}
9999
})
100-
})
100+
// Prepare the export chart data
101101
const totalExportData = {
102102
labels: year,
103103
datasets:[{
@@ -108,7 +108,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
108108
tension: 0.0,
109109
}]
110110
}
111-
111+
// Draw the export chart
112112
const totalExportChart = new Chart(exportTot, {
113113
type: 'line',
114114
data: totalExportData,
@@ -131,7 +131,7 @@ <h1>Welcome to the Finance Data visualization Page!</h1>
131131
}
132132
})
133133
})
134-
134+
// getting IDs of the chart divs
135135
const importTot = document.getElementById('totalImport');
136136
const exportTot = document.getElementById('totalExport');
137137
</script>

Mainpages/dataPages/propertyData.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>
@@ -81,14 +81,15 @@ <h1>Welcome to the Housing Price Data visualization Page!</h1>
8181
<script>
8282
const housingPriceData = '/Datasets/average-house-prices-england.csv';
8383
d3.csv(housingPriceData).then(function (datapoints){
84+
// prepare the variables used by the graphs and push values into them
8485
const housingPriceDate = [];
8586
const housingAveragePrice = [];
8687

8788
for (i = 0; i < datapoints.length; i++){
8889
housingPriceDate.push(datapoints[i].Date)
8990
housingAveragePrice.push(datapoints[i]['Average_Price'])
9091
}
91-
92+
// prep the house price data for England
9293
const housePriceEngData = {
9394
labels: housingPriceDate,
9495
datasets:[{
@@ -99,7 +100,7 @@ <h1>Welcome to the Housing Price Data visualization Page!</h1>
99100
tension: 0.0,
100101
}]
101102
}
102-
103+
// draw the eng house price chart
103104
const housingPriceEngChart = new Chart(houseEngTot, {
104105
type: 'line',
105106
data: housePriceEngData,
@@ -122,8 +123,11 @@ <h1>Welcome to the Housing Price Data visualization Page!</h1>
122123
}
123124
})
124125
})
126+
// get the house price eng elementID
125127
const houseEngTot = document.getElementById('housingPriceEng');
126128

129+
// Repeat this two more times but for Scotland and Wales, comments would be identical and unnecessary.
130+
127131
const housingPriceDataWales = '/Datasets/average-house-prices-wales.csv';
128132
d3.csv(housingPriceDataWales).then(function (datapoints){
129133
const housingPriceDateWales = [];

Mainpages/dataPages/woodlandArea.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
17-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
17+
<li class="right"><a href="/about.html">About</a></li>
1818
</ul>
1919

2020
<div class=mappingTitle>

README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
<body>
1414
<ul class="navigationBar">
15-
<li><a href="/Mainpages/index.html">Home</a></li>
16-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/mapping.html">Open Data</a></li>
1717
<li class="right"><a class="active right">About</a></li>
1818
</ul>
1919

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<body>
1212
<ul class="navigationBar">
1313
<li><a class="active">Home</a></li>
14-
<li><a href="/Mainpages/mapping.html">Open Data</a></li>
15-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
14+
<li><a href="/mapping.html">Open Data</a></li>
15+
<li class="right"><a href="/about.html">About</a></li>
1616
</ul>
1717

1818
<div class="textBox">
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
<body>
1212
<ul class="navigationBar">
13-
<li><a href="/Mainpages/index.html">Home</a></li>
13+
<li><a href="/index.html">Home</a></li>
1414
<li><a class="active">Open Data</a></li>
15-
<li class="right"><a href="/Mainpages/about.html">About</a></li>
15+
<li class="right"><a href="/about.html">About</a></li>
1616
</ul>
1717

1818
<div class="textBoxMapping">

0 commit comments

Comments
 (0)